-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(design): allow the whole typography subpackaged to be exported a…
…nd allow body-font-family variable to be assignable
- Loading branch information
Showing
11 changed files
with
171 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
@use '../layout'; | ||
|
||
$font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, | ||
Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji' !default; | ||
$font-family-mono: ui-monospace, 'SFMono-Regular', SF Mono, Menlo, Consolas, | ||
'Liberation Mono', monospace; | ||
|
||
// these three variables will be deprecated in v1.0.0 in favor of more consistent naming | ||
$body-font-family: $font-family-base; | ||
$base-font-family: $body-font-family; | ||
$monospace-font-family: $font-family-mono; | ||
|
||
$font-size-sm: 0.875rem; | ||
$font-size-base: 1rem; | ||
$font-size-md: 1.25rem; | ||
$font-size-lg: 1.5rem; | ||
|
||
// these variables will be deprecated in v1.0.0 in favor of more consistent naming | ||
$large-font-size: 1.5rem; | ||
$medium-font-size: 1.25rem; | ||
$normal-font-size: 1rem; | ||
$small-font-size: 0.875rem; | ||
|
||
$bold-font-weight: bold; | ||
|
||
// Changes the weight of text to bold | ||
@mixin embolden() { | ||
font-weight: $bold-font-weight; | ||
} | ||
|
||
@mixin headline-xl() { | ||
@include embolden(); | ||
font-size: 2.5rem; | ||
line-height: 2.75rem; | ||
|
||
@include layout.breakpoint(tablet) { | ||
font-size: 3.5rem; | ||
line-height: 4rem; | ||
} | ||
} | ||
|
||
@mixin headline-lg() { | ||
@include embolden(); | ||
font-size: 2rem; | ||
line-height: 2.25rem; | ||
|
||
@include layout.breakpoint(tablet) { | ||
font-size: 3rem; | ||
line-height: 3.5rem; | ||
} | ||
} | ||
|
||
@mixin headline-md() { | ||
@include embolden(); | ||
font-size: 1.5rem; | ||
line-height: 1.75rem; | ||
|
||
@include layout.breakpoint(tablet) { | ||
font-size: 2rem; | ||
line-height: 2.5rem; | ||
} | ||
} | ||
|
||
@mixin headline-sm() { | ||
@include embolden(); | ||
font-size: 1.25rem; | ||
line-height: 1.5rem; | ||
|
||
@include layout.breakpoint(tablet) { | ||
font-size: 1.5rem; | ||
line-height: 2rem; | ||
} | ||
} | ||
|
||
@mixin body-lg() { | ||
font-size: 1.5rem; | ||
font-weight: 400; | ||
line-height: 2rem; | ||
} | ||
|
||
@mixin body-md() { | ||
font-size: 1.25rem; | ||
font-weight: 400; | ||
line-height: 1.75rem; | ||
} | ||
|
||
@mixin body-sm() { | ||
font-size: 1rem; | ||
font-weight: 400; | ||
line-height: 1.5rem; | ||
} | ||
|
||
@mixin body-xs() { | ||
font-size: 0.875rem; | ||
font-weight: 400; | ||
line-height: 1.25rem; | ||
} | ||
|
||
@mixin subheading() { | ||
font-size: 0.875rem; | ||
font-weight: 600; | ||
letter-spacing: 0.03125rem; | ||
line-height: 1rem; | ||
text-transform: uppercase; | ||
} | ||
|
||
@mixin caption() { | ||
font-size: 0.75rem; | ||
line-height: 1rem; | ||
font-weight: 400; | ||
} | ||
|
||
// Forces a line of text to ellipsis once it reaches the | ||
// width of its container. It should only be used if the element | ||
// is `display: block` or `display: inline-block`. | ||
|
||
@mixin text-truncate() { | ||
display: block; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
|
||
// @deprecated in v1.0 in favor of text-truncate | ||
@mixin single-line-ellipsis() { | ||
@include text-truncate(); | ||
} | ||
|
||
// @deprecated in v1.0.0 | ||
@mixin uppercase() { | ||
text-transform: uppercase; | ||
} | ||
|
||
.embolden { /* stylelint-disable-line selector-class-pattern */ | ||
@include embolden(); | ||
} | ||
|
||
.uppercase { /* stylelint-disable-line selector-class-pattern */ | ||
text-transform: uppercase; | ||
} | ||
|
||
// deprecate in v1.0 | ||
.single-line-ellipsis { /* stylelint-disable-line selector-class-pattern */ | ||
@include single-line-ellipsis(); | ||
} | ||
|
||
.text-truncate { /* stylelint-disable-line selector-class-pattern */ | ||
@include text-truncate(); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.