-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ui] Themes #18442
[ui] Themes #18442
Conversation
## Summary & Motivation Add a legacy theme to keep the colors mostly unchanged while working on the new palettes. ## How I Tested These Changes
## Summary & Motivation Adds a bunch of small style tweaks to the dark and light themes ## How I Tested These Changes Booted up the UI and tried it
[INTERNAL_BRANCH=dish/cloud-palettes]
## Summary & Motivation More theme style tweaks ## How I Tested These Changes Booted up the UI --------- Co-authored-by: Isaac Hellendag <[email protected]> Co-authored-by: Isaac Hellendag <[email protected]>
Deploy preview for dagit-storybook ready! ✅ Preview Built with commit fd59242. |
Deploy preview for dagit-core-storybook ready! ✅ Preview Built with commit fd59242. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome. The approach seems solid and I'm a big fan of the semantic naming of the color values. Props for going through and re-classifying everything, this must have taken a while! 💯
@@ -101,7 +103,7 @@ const Form = ({dismiss, submit}: FormProps) => { | |||
> | |||
<Box flex={{direction: 'column', gap: 8, alignItems: 'start', justifyContent: 'start'}}> | |||
<Heading>Join the Dagster community</Heading> | |||
<Body style={{color: Colors.Gray700, marginBottom: '4px'}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, but was moving to base exports from ui-components explicit? I guess this could have stayed Colors.textLight()
, curious if that'd be better / worse (though arguably not better enough to be worth changing now!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess we could have the functions namespaced under Colors
. If you guys feel strongly about doing that instead, we could do a find/replace for it.
style={{width: '100%'}} | ||
/> | ||
{emailChanged && blurred && !validEmail ? ( | ||
<div style={{paddingBottom: '12px', color: Colors.Red500, fontSize: '12px'}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed that this "Red500" and the above "Red500" were changed differently based on the context of use which is awesome but... must have taken a while. Thanks for doing all this!
@@ -35,31 +45,34 @@ const StarIcon = ({checked, indeterminate, fillColor, disabled}: IconProps) => ( | |||
<path | |||
className="interaction-focus-outline" | |||
d="M8.99983 14.27L13.1498 16.78C13.9098 17.24 14.8398 16.56 14.6398 15.7L13.5398 10.98L17.2098 7.80001C17.8798 7.22001 17.5198 6.12001 16.6398 6.05001L11.8098 5.64001L9.91983 1.18001C9.57983 0.37001 8.41983 0.37001 8.07983 1.18001L6.18983 5.63001L1.35983 6.04001C0.479829 6.11001 0.119828 7.21001 0.789828 7.79001L4.45983 10.97L3.35983 15.69C3.15983 16.55 4.08983 17.23 4.84983 16.77L8.99983 14.27Z" | |||
fill={Colors.White} | |||
fill={disabled ? colorBackgroundGray() : colorBackgroundDefault()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the strategy you've taken here (color functions) as opposed to using styled-components Theme
support or @media(prefer-color-scheme: dark)
. I've seen other apps that try to sync to the system theme via CSS, but then /every single color reference/ needs to be in CSS (or tied to fancy media-watching JS) because the value can change without a page reload.
I like that this solution still lets us interpolate the color at render time and slap it wherever we need to. Slight bummer that at 5:00pm it won't auto-shift to dark mode without a page reload, but the engineering cost for that one page load is HIGH and not worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I've seen the 5pm shift before! I'm just always in dark mode. We could come back to this if it seems important to users.
[ColorName.DataVizVioletAlt]: DataVizColors.Violet300, | ||
[ColorName.DataVizYellow]: DataVizColors.Yellow200, | ||
[ColorName.DataVizYellowAlt]: DataVizColors.Yellow300, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the DataViz family names :)
border-bottom-left-radius: 8px; | ||
border-bottom-right-radius: 8px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated but seems fine!
position: relative; | ||
transition: all 150ms linear; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh does this animate the border change on click?
box-shadow: rgba(0, 0, 0, 0.12) 0px 2px 12px 0px; | ||
scale: 1.03; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a bit interesting (and new i think?), might be worth a comment about what this does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did added this one. It adds a slight scale effect on hover. We have the same effect on the new group nodes as well. happy to revisit this if y'all find it distracting but the primary motivation for adding it was that we previously relied on a box shadow for the node hover style, and this doesn't show up well in dark mode. The scale transition works well in both light and dark mode
## Summary & Motivation Introduce a system for theming the Dagster UI. All direct references to color values are replaced by a set of functions that match semantic color names to theme-based palette values. The theme value is exposed via a User Setting. Discussion here: dagster-io#18439 ## How I Tested These Changes TS, lint, jest. Find all existing references to `LegacyColors`, hex values, rgb/rgba values and replace them with color functions. Navigate throughout the app in legacy, light, and dark modes. Verify that colors look appropriate. --------- Co-authored-by: Josh Braun <[email protected]>
Summary & Motivation
Introduce a system for theming the Dagster UI. All direct references to color values are replaced by a set of functions that match semantic color names to theme-based palette values.
The theme value is exposed via a User Setting.
Discussion here: #18439
How I Tested These Changes
TS, lint, jest. Find all existing references to
LegacyColors
, hex values, rgb/rgba values and replace them with color functions.Navigate throughout the app in legacy, light, and dark modes. Verify that colors look appropriate.