Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Components: Add themeable background color #45466
Components: Add themeable background color #45466
Changes from all commits
0d392c9
64a2172
0c6a7fc
6d5977a
9b519d4
a9b184c
e6e12c6
8ebc4e5
ef37c95
b385609
4e91554
b6f567a
17986d4
2b74866
f2fab80
5db9b4b
90c4d51
48f50e6
9d63099
1fc450c
b490e41
e55e47e
a510318
6fd310e
64a27f3
f5f0d63
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Out of curiosity, any reason why we don't generate a
gray-900
color?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.
In the context of our color system,
gray-900
is always the same asforeground
. So it was redundant.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.
Are these opacity values? Just curious on how the hex colors are calculated. This is cool stuff.
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.
These are "darkness" values, i.e. the inverse of the Lightness value in HSL.
gray-100
#f0f0f0
ishsl(0, 0%, 94%)
(1 - 0.94 = 0.06, etc)gray-200
#e0e0e0
ishsl(0, 0%, 88%)
and so on...That said, we might eventually switch from HSL to LCH for internal calculations so the lightness differences are a bit more reliable than HSL.
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.
Very cool, thank you! I like the sound of that, in the past I explored HSL for component theming, and the opportunities are pretty cool. That's not to say the approach I explored there is the right one — just that it's nice to be able to feed a single hue value, and have the rest refer to that.
Edit: Especially useful if it means we can retire light/dark versions of the spot color, so we have just a single spot color.
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.
Currently,
gray-100
could be the brightest or the darkest color in the scale of grays, depending on whether thebackground
color is classified as "dark" bycolord
.Could this cause confusion in the consumers of the theme? My experience as a developer has taught me that usually
100
is always associated to a brighter color, and900
to a darker.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 have an alternative for that problem specifically. Though, I'm expecting that most usages won't be using these gray colors directly, but instead through more semantically named variables (e.g.
border
,lightBorder
,secondaryText
, etc).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.
Ok. Let's get a feeling for it and see if we need to make any adjustments (at most we could add a line to our docs ?)