-
-
Notifications
You must be signed in to change notification settings - Fork 567
1046: Add color utility classes #1053
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
1046: Add color utility classes #1053
Conversation
| ); | ||
|
|
||
| @each $name, $var in $text-colors { | ||
| .u-text-#{$name} { |
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.
Does KSS work inside a loop?
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.
A: Not quite… I wondered whether the variables would be processed.
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 went down a rabbit hole about this. It turns out Sass isn't built to dynamically generate comments, unfortunately.
| } | ||
|
|
||
| .u-fill-#{$name} { | ||
| fill: $var; |
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.
What are your thoughts on using !important on these utilities? I popped a fill class on the logo, but because they're imported early on, it was superseded by c-logo__icon.
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'd prefer to keep it off. I don't mind occasionally using color declarations outside of scope the utility classes, so long as there's a specific design need.
ericwbailey
left a comment
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 see you found the very half-baked styleguide 😅
| ); | ||
|
|
||
| @each $name, $var in $text-colors { | ||
| .u-text-#{$name} { |
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 went down a rabbit hole about this. It turns out Sass isn't built to dynamically generate comments, unfortunately.
| } | ||
|
|
||
| .u-fill-#{$name} { | ||
| fill: $var; |
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'd prefer to keep it off. I don't mind occasionally using color declarations outside of scope the utility classes, so long as there's a specific design need.
|
@ericwbailey Are there any further changes I can make to see this over the line? I'm not sure whether the original scope covered implementing the classes as well, but I am happy to do that – whether in this PR or a new branch. |
|
@danielmatthew Ah shoot, sorry about that. I've had a pretty demanding client so my attention has been all over the place. No changes needed, this is a great addition! Thank you again for your help. |
|
@ericwbailey No worries – I understand. Happy to look out for future 'help wanteds' 🥳 |
This PR uses a map of the colour variables to create utility classes for
color,background-colorandfill.Closes #1046