Skip to content

Commit

Permalink
add 'lighter' and 'bolder' font weight classes (#26580)
Browse files Browse the repository at this point in the history
* 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, #23969, but it's a start

* Update .stylelintrc

* add 'lighter' and 'bolder' variables per @mdo 's request.
  • Loading branch information
browner12 authored and mdo committed Jul 25, 2018
1 parent 3b55873 commit c8a4d9d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"declaration-empty-line-before": null,
"declaration-no-important": true,
"font-family-name-quotes": "always-where-recommended",
"font-weight-notation": "numeric",
"font-weight-notation": [
"numeric", {
"ignore": ["relative"]
}],
"function-url-no-scheme-relative": true,
"function-url-quotes": "always",
"length-zero-no-unit": true,
Expand Down
2 changes: 2 additions & 0 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,11 @@ $font-size-base: 1rem !default; // Assumes the browser default, typ
$font-size-lg: ($font-size-base * 1.25) !default;
$font-size-sm: ($font-size-base * .875) !default;

$font-weight-lighter: lighter !default;
$font-weight-light: 300 !default;
$font-weight-normal: 400 !default;
$font-weight-bold: 700 !default;
$font-weight-bolder: bolder !default;

$font-weight-base: $font-weight-normal !default;
$line-height-base: 1.5 !default;
Expand Down
10 changes: 6 additions & 4 deletions scss/utilities/_text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@

// Weight and italics

.font-weight-light { font-weight: $font-weight-light !important; }
.font-weight-normal { font-weight: $font-weight-normal !important; }
.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: $font-weight-lighter !important; }
.font-weight-normal { font-weight: $font-weight-normal !important; }
.font-weight-bold { font-weight: $font-weight-bold !important; }
.font-weight-bolder { font-weight: $font-weight-bolder !important; }
.font-italic { font-style: italic !important; }

// Contextual colors

Expand Down

0 comments on commit c8a4d9d

Please sign in to comment.