-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
add 'lighter' and 'bolder' font weight classes #26580
Conversation
these are 2 special values for font weight, that will give their content a font-weight value of 100 more or less than their inherited font-weight. probably doesn't fully fulfill this issue, twbs#23969, but it's a start
to fix these errors I guess we'd have to update https://github.com/twbs/bootstrap/blob/v4-dev/.stylelintrc#L21 I can't speak to the original intent behind using this rule, so I'm not sure what the appropriate answer is. |
Don't bolder and lighter have numeric equivalents? |
they are relative to the inherited/current value, so no |
'bold' is equivalent to 700. 'lighter' and 'bolder' are variable, and are either 100 more or less than the value they inherit. <div style="font-weight:600; ">
<div style="font-weight:lighter; ">This text will be 500 weight.</div>
<div style="font-weight:bolder; ">This text will be 700 weight.</div>
</div> |
Yup, I figured so after commenting :) I pushed a patch to ignore those, let me see if it's passing. |
Ok, it's passing, so it's just a matter if we want this in or not. /CC @mdo @andresgalante |
These utility classes might need more documentation. There will be more people who think these values have numeric equivalents. |
sounds good. if it get's accepted i'll add some docs. |
It's already been accepted for v4.2 :) |
really? link? |
What I mean is that the plan is to merge in 4.2. See the project associated with this PR. |
scss/utilities/_text.scss
Outdated
.font-weight-bold { font-weight: $font-weight-bold !important; } | ||
.font-italic { font-style: italic !important; } | ||
.font-weight-light { font-weight: $font-weight-light !important; } | ||
.font-weight-lighter { font-weight: lighter !important; } |
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.
would this need to stay uniform with the other styles and be
lighter -> $font-weight-lighter,
bolder -> $font-weight-bolder, etc?
would there need to be additions to make this work?
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.
Those are CSS values.
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.
Per the conversation at https://github.com/twbs/bootstrap/pull/26580/files#r193721911, let's make these variables so that folks can change them if they so choose. I know these values are inherently relative, but they could easily be remapped to 100
and 900
depending on the situation.
sorry, but I have to disagree with that suggestion. for values like also, from my experience, most fonts used on websites don't even have more than 3 weights available as part of the font, so the |
I understand their intended usage, but people do whatever they want with CSS like this. 😆 My point is, if we include two new variables here, we'll be helping folks who want to have explicit options here. As soon as these become utilities and variables, it's an opportunity to move away from browser default values. Take this example below: both are valid in their own contexts. .font-weight-lighter { font-weight-lighter: lighter; }
.font-weight-light { font-weight-lighter: light; }
.font-weight-lighter { font-weight-lighter: 100; }
.font-weight-light { font-weight-lighter: 300; } |
per @mdo 's request.
alright, the variables have been added. |
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.
Thank you!
these are 2 special values for font weight, that will give their content a font-weight value of 100 more or less than their inherited font-weight.
probably doesn't fully fulfill this issue, #23969, but it's a start