Skip to content

Commit

Permalink
fix(tokens)!: rename --font-family-body to font-family-base
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfeldpausch committed Oct 27, 2023
1 parent bc8d8d8 commit c6804d9
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 25 deletions.
2 changes: 1 addition & 1 deletion core/src/styles/core/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ body {

body {
@include cat-body('m');
font-family: cat-token('font.family.body'), $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
font-family: cat-token('font.family.base'), $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
color: cat-token('color.ui.font.base');
}
2 changes: 2 additions & 0 deletions core/src/styles/core/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ code {
:where(h1, h2, h3),
:is(.cat-h1, .cat-h2, .cat-h3) {
color: $cat-font-color-head;
font-family: $cat-font-family-head, $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
margin-bottom: calc($cat-head-margin-bottom * var(--cat-article-spacer, 1));

&:has(+ h1, + h2, + h3, + h4, + h5, + h6, + .cat-h1, + .cat-h2, + .cat-h3, + .cat-h4, + .cat-h5, + .cat-h6) {
Expand All @@ -227,6 +228,7 @@ code {
:where(h4, h5, h6),
:is(.cat-h4, .cat-h5, .cat-h6) {
color: $cat-font-color-head;
font-family: $cat-font-family-head, $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
margin-bottom: calc($cat-head-margin-bottom * 0.5 * var(--cat-article-spacer, 1));
}

Expand Down
3 changes: 1 addition & 2 deletions core/src/styles/utils/_typography.mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
}

@mixin cat-head($size, $weight: cat-token('font.weight.head')) {
// skip color, as it is only set for editorial styles
font-family: $cat-font-family-head, $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
// skip color and family, as it is only set for editorial styles
font-size: cat-head-font-size($size);
line-height: cat-head-line-height($size);
font-weight: $weight;
Expand Down
63 changes: 63 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions tokens/dist/export/figma.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,11 +607,7 @@
},
"font": {
"family": {
"head": {
"$type": "fontFamily",
"$value": "Lato"
},
"body": {
"base": {
"$type": "fontFamily",
"$value": "Lato"
},
Expand Down
6 changes: 1 addition & 5 deletions tokens/dist/export/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,7 @@
"$type": "color",
"$value": "#ffffff"
},
"font-family-head": {
"$type": "fontFamily",
"$value": "Lato"
},
"font-family-body": {
"font-family-base": {
"$type": "fontFamily",
"$value": "Lato"
},
Expand Down
6 changes: 1 addition & 5 deletions tokens/dist/export/zeroheight.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,11 +785,7 @@
},
"font": {
"family": {
"head": {
"$type": "fontFamily",
"$value": "Lato"
},
"body": {
"base": {
"$type": "fontFamily",
"$value": "Lato"
},
Expand Down
9 changes: 2 additions & 7 deletions tokens/src/font.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
{
"font": {
"family": {
"head": {
"$type": "fontFamily",
"$value": "{asset.font.lato.name.value}",
"cssProp": "font-family-head"
},
"body": {
"base": {
"$type": "fontFamily",
"$value": "{asset.font.lato.name.value}",
"cssProp": "font-family-body"
"cssProp": "font-family-base"
},
"mono": {
"$type": "fontFamily",
Expand Down

0 comments on commit c6804d9

Please sign in to comment.