Skip to content

Commit c8a4d9d

Browse files
browner12mdo
authored andcommitted
add 'lighter' and 'bolder' font weight classes (twbs#26580)
* add 'lighter' and 'bolder' font weight classes 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 * Update .stylelintrc * add 'lighter' and 'bolder' variables per @mdo 's request.
1 parent 3b55873 commit c8a4d9d

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.stylelintrc

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
"declaration-empty-line-before": null,
1919
"declaration-no-important": true,
2020
"font-family-name-quotes": "always-where-recommended",
21-
"font-weight-notation": "numeric",
21+
"font-weight-notation": [
22+
"numeric", {
23+
"ignore": ["relative"]
24+
}],
2225
"function-url-no-scheme-relative": true,
2326
"function-url-quotes": "always",
2427
"length-zero-no-unit": true,

scss/_variables.scss

+2
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,11 @@ $font-size-base: 1rem !default; // Assumes the browser default, typ
257257
$font-size-lg: ($font-size-base * 1.25) !default;
258258
$font-size-sm: ($font-size-base * .875) !default;
259259

260+
$font-weight-lighter: lighter !default;
260261
$font-weight-light: 300 !default;
261262
$font-weight-normal: 400 !default;
262263
$font-weight-bold: 700 !default;
264+
$font-weight-bolder: bolder !default;
263265

264266
$font-weight-base: $font-weight-normal !default;
265267
$line-height-base: 1.5 !default;

scss/utilities/_text.scss

+6-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232

3333
// Weight and italics
3434

35-
.font-weight-light { font-weight: $font-weight-light !important; }
36-
.font-weight-normal { font-weight: $font-weight-normal !important; }
37-
.font-weight-bold { font-weight: $font-weight-bold !important; }
38-
.font-italic { font-style: italic !important; }
35+
.font-weight-light { font-weight: $font-weight-light !important; }
36+
.font-weight-lighter { font-weight: $font-weight-lighter !important; }
37+
.font-weight-normal { font-weight: $font-weight-normal !important; }
38+
.font-weight-bold { font-weight: $font-weight-bold !important; }
39+
.font-weight-bolder { font-weight: $font-weight-bolder !important; }
40+
.font-italic { font-style: italic !important; }
3941

4042
// Contextual colors
4143

0 commit comments

Comments
 (0)