v6: Use token Sass map to customize CSS variables instead of Sass variables#41983
Open
v6: Use token Sass map to customize CSS variables instead of Sass variables#41983
Conversation
938560f to
49a9e54
Compare
c863123 to
d64c716
Compare
|
I had a look over this proposed change, this looks amazing. It feels much cleaner to have (almost) everything related to customizing a component in a map, it adds this feeling of component-scope configuration to it, I love this change. I'd love to see this being pushed forward. +1 from me. |
238fb1e to
2806237
Compare
- New CSS vars and tokens - New mixins
d9fbdde to
6d2db4c
Compare
Member
Author
|
Test failure due to Coveralls outage: https://status.coveralls.io. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This a cool idea IMO, but needs a little fleshing out. An annoying (to me) pattern we have in v6 (and v5 in a different way) is that we have Sass variables at the top of component files that are immediately mapped to CSS variables on the component classes, where we then only use the CSS variables. To customize with Sass, we'd do this:
Neat, but what if we cut out the middle man in our development—meaning no more Sass vars for the components—and instead use a token map that gets emitted onto the component class of our choosing? Something like this:
Which would allow us to do this instead:
Of course we'd still have some Sass variables—it's how we generate our colors and more. But for the realtime customization that we all want out of a library like this, I think it could be fun. This keeps all the really powerful parts of Sass—functions, mixins, loops, maps, etc—and gives a singular avenue for customization regardless of compilation method.
@useAnd for folks who want more power—like customizing the utility API, toggling global options, etc—Sass is still there to do what you want at any point.
Potentially fun idea, needs feedback.