-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[K7] Font sizing, weights, families and mixins #12879
Conversation
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.
Just had some questions that didn't occur to me the first time around!
style_guides/scss_style_guide.md
Outdated
## Dealing with extends | ||
|
||
You should try never to use the extends functionality in sass. The one exception is when you are extending placeholders to help control maintainabilty. General rule: if it creates an additive selector, it's usually a bad usage of extends. |
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.
Dumb question: what's an additive selector?
|
||
@mixin fontSize($size: $kuiFontSize) { | ||
font-size: $size; | ||
font-size: convert-to-rem($size); |
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.
Can we add a comment explaining why we're using both px
and rem
?
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.
And why are we calling convert-to-rem
when the name of the function is convertToRem
?
$kuiFontSizeM: $kuiFontSize; | ||
$kuiFontSizeL: 24px; | ||
$kuiFontSizeXL: 32px; | ||
$kuiFontSizeXXL: 48px; |
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.
Should these other sizes be multiples of $kuiFontSize
? So if $kuiSize
changes, then everything changes?
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.
Also, is there a reason not to convert these variables to rem here in their definition?
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 like to still try and account for older versions of IE since we target enterprise. the fontSize
mixin basically spits out both, but I need a base pixel value to output.
} | ||
|
||
%kuiFontSizeXXL { | ||
font-size: rem($kuiFontSizeXXL); |
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's the rem
function? Where does this come from and what's the difference with convertToRem
?
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.
😎 Cool!
Sets up mixins and placeholders for typography.
Sets up mixins and placeholders for typography.
Sets up mixins and placeholders for typography.
Sets up mixins and placeholders for typography.
Replaces #12876
Scaffolding and mixins for dealing with font sizing and weights. Dupes rems in so we can scale.