-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui] Use CSS vars for theming (#21200)
## Summary & Motivation Use CSS vars instead of JS strings to set themed values. The main benefit of this is that it will no longer require reloading the page to see the theme update: when you change the theme in User Settings, it will update immediately. Additionally, if the user's OS is set to change from light to dark (and vice versa) based on time of day, and they are using the "System" theme, the theme change should now occur automatically, without a browser reload. I have addressed a couple of items with inline comments. https://github.com/dagster-io/dagster/assets/2823852/8e51bbce-6675-470b-b052-db7c51773bc4 ## How I Tested These Changes Load app, change theme. Verify that it updates right away. Click around the app, verify that everything looks correct.
- Loading branch information
Showing
43 changed files
with
1,095 additions
and
731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
js_modules/dagster-ui/packages/ui-components/src/palettes/CoreColorStyles.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import {createGlobalStyle} from 'styled-components'; | ||
|
||
export const CoreColorStyles = createGlobalStyle` | ||
:root { | ||
--color-core-blue990: rgba(14, 15, 52, 1); | ||
--color-core-blue950: rgba(17, 18, 62, 1); | ||
--color-core-blue900: rgba(25, 24, 82, 1); | ||
--color-core-blue800: rgba(33, 30, 102, 1); | ||
--color-core-blue700: rgba(48, 43, 141, 1); | ||
--color-core-blue600: rgba(64, 55, 181, 1); | ||
--color-core-blue500: rgba(79, 67, 221, 1); | ||
--color-core-blue400: rgba(114, 105, 228, 1); | ||
--color-core-blue300: rgba(149, 142, 235, 1); | ||
--color-core-blue200: rgba(185, 180, 241, 1); | ||
--color-core-blue100: rgba(220, 217, 248, 1); | ||
--color-core-blue50: rgba(237, 236, 252, 1); | ||
--color-core-blue10: rgba(246, 246, 253, 1); | ||
--color-core-red990: rgba(33, 15, 27, 1); | ||
--color-core-red950: rgba(44, 18, 28, 1); | ||
--color-core-red900: rgba(64, 24, 31, 1); | ||
--color-core-red800: rgba(85, 30, 34, 1); | ||
--color-core-red700: rgba(127, 42, 41, 1); | ||
--color-core-red600: rgba(168, 54, 47, 1); | ||
--color-core-red500: rgba(210, 66, 53, 1); | ||
--color-core-red400: rgba(219, 104, 93, 1); | ||
--color-core-red300: rgba(228, 142, 134, 1); | ||
--color-core-red200: rgba(237, 179, 174, 1); | ||
--color-core-red100: rgba(246, 217, 215, 1); | ||
--color-core-red50: rgba(250, 236, 235, 1); | ||
--color-core-red10: rgba(253, 246, 245, 1); | ||
--color-core-yellow990: rgba(36, 29, 26, 1); | ||
--color-core-yellow950: rgba(47, 36, 27, 1); | ||
--color-core-yellow900: rgba(70, 51, 30, 1); | ||
--color-core-yellow800: rgba(93, 66, 32, 1); | ||
--color-core-yellow700: rgba(138, 97, 37, 1); | ||
--color-core-yellow600: rgba(184, 127, 42, 1); | ||
--color-core-yellow500: rgba(229, 157, 47, 1); | ||
--color-core-yellow400: rgba(234, 177, 89, 1); | ||
--color-core-yellow300: rgba(239, 196, 130, 1); | ||
--color-core-yellow200: rgba(245, 216, 172, 1); | ||
--color-core-yellow100: rgba(245, 216, 172, 1); | ||
--color-core-yellow50: rgba(252, 245, 234, 1); | ||
--color-core-yellow10: rgba(252, 245, 234, 1); | ||
--color-core-green990: rgba(9, 36, 38, 1); | ||
--color-core-green950: rgba(11, 46, 43, 1); | ||
--color-core-green900: rgba(15, 65, 54, 1); | ||
--color-core-green800: rgba(20, 85, 65, 1); | ||
--color-core-green700: rgba(28, 125, 86, 1); | ||
--color-core-green600: rgba(37, 164, 108, 1); | ||
--color-core-green500: rgba(46, 204, 129, 1); | ||
--color-core-green400: rgba(88, 214, 154, 1); | ||
--color-core-green300: rgba(130, 224, 179, 1); | ||
--color-core-green200: rgba(171, 235, 205, 1); | ||
--color-core-green100: rgba(213, 245, 230, 1); | ||
--color-core-green50: rgba(234, 250, 242, 1); | ||
--color-core-green10: rgba(245, 252, 249, 1); | ||
--color-core-lime990: rgba(0, 38, 11, 1); | ||
--color-core-lime950: rgba(0, 38, 11, 1); | ||
--color-core-lime900: rgba(0, 101, 28, 1); | ||
--color-core-lime800: rgba(0, 155, 43, 1); | ||
--color-core-lime700: rgba(5, 213, 63, 1); | ||
--color-core-lime600: rgba(37, 240, 94, 1); | ||
--color-core-lime500: rgba(81, 233, 124, 1); | ||
--color-core-lime400: rgba(116, 237, 150, 1); | ||
--color-core-lime300: rgba(151, 242, 176, 1); | ||
--color-core-lime200: rgba(185, 246, 203, 1); | ||
--color-core-lime100: rgba(220, 251, 229, 1); | ||
--color-core-lime50: rgba(238, 253, 242, 1); | ||
--color-core-lime10: rgba(246, 254, 248, 1); | ||
--color-core-cyan990: rgba(13, 32, 50, 1); | ||
--color-core-cyan950: rgba(17, 41, 60, 1); | ||
--color-core-cyan900: rgba(24, 58, 78, 1); | ||
--color-core-cyan800: rgba(31, 76, 97, 1); | ||
--color-core-cyan700: rgba(46, 110, 135, 1); | ||
--color-core-cyan600: rgba(60, 145, 172, 1); | ||
--color-core-cyan500: rgba(75, 180, 210, 1); | ||
--color-core-cyan400: rgba(111, 195, 219, 1); | ||
--color-core-cyan300: rgba(147, 210, 228, 1); | ||
--color-core-cyan200: rgba(183, 225, 237, 1); | ||
--color-core-cyan100: rgba(219, 240, 246, 1); | ||
--color-core-cyan50: rgba(237, 247, 250, 1); | ||
--color-core-cyan10: rgba(246, 251, 253, 1); | ||
--color-core-olive990: rgba(25, 31, 41, 1); | ||
--color-core-olive950: rgba(33, 39, 48, 1); | ||
--color-core-olive900: rgba(48, 56, 61, 1); | ||
--color-core-olive800: rgba(64, 72, 74, 1); | ||
--color-core-olive700: rgba(94, 106, 99, 1); | ||
--color-core-olive600: rgba(125, 139, 125, 1); | ||
--color-core-olive500: rgba(156, 172, 151, 1); | ||
--color-core-olive400: rgba(176, 189, 172, 1); | ||
--color-core-olive300: rgba(196, 205, 193, 1); | ||
--color-core-olive200: rgba(215, 222, 213, 1); | ||
--color-core-olive100: rgba(235, 238, 234, 1); | ||
--color-core-olive50: rgba(245, 247, 245, 1); | ||
--color-core-olive10: rgba(250, 251, 250, 1); | ||
--color-core-gray990: rgba(3, 6, 21, 1); | ||
--color-core-gray950: rgba(13, 17, 33, 1); | ||
--color-core-gray900: rgba(23, 28, 44, 1); | ||
--color-core-gray850: rgba(33, 39, 56, 1); | ||
--color-core-gray800: rgba(43, 50, 68, 1); | ||
--color-core-gray750: rgba(53, 61, 80, 1); | ||
--color-core-gray700: rgba(63, 72, 91, 1); | ||
--color-core-gray650: rgba(73, 83, 103, 1); | ||
--color-core-gray600: rgba(83, 94, 115, 1); | ||
--color-core-gray550: rgba(93, 105, 126, 1); | ||
--color-core-gray500: rgba(103, 116, 138, 1); | ||
--color-core-gray450: rgba(118, 130, 150, 1); | ||
--color-core-gray400: rgba(133, 144, 161, 1); | ||
--color-core-gray350: rgba(149, 158, 173, 1); | ||
--color-core-gray300: rgba(164, 172, 185, 1); | ||
--color-core-gray250: rgba(179, 185, 197, 1); | ||
--color-core-gray200: rgba(194, 199, 208, 1); | ||
--color-core-gray150: rgba(209, 213, 220, 1); | ||
--color-core-gray100: rgba(225, 227, 232, 1); | ||
--color-core-gray50: rgba(240, 241, 243, 1); | ||
--color-core-gray10: rgba(247, 248, 249, 1); | ||
--color-core-white: rgba(255, 255, 255, 1); | ||
} | ||
`; |
Oops, something went wrong.
64ba7b8
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.
Deploy preview for dagit-storybook ready!
✅ Preview
https://dagit-storybook-8d1rmy09q-elementl.vercel.app
Built with commit 64ba7b8.
This pull request is being automatically deployed with vercel-action
64ba7b8
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.
Deploy preview for dagit-core-storybook ready!
✅ Preview
https://dagit-core-storybook-np1anlgcd-elementl.vercel.app
Built with commit 64ba7b8.
This pull request is being automatically deployed with vercel-action