Navigation Menu

Skip to content

Commit

Permalink
fix: spacing and font vars
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemai2awesome committed Jun 8, 2020
1 parent ccdd0f3 commit 1406a3e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
17 changes: 12 additions & 5 deletions packages/components/bolt-text/src/text.scss
Expand Up @@ -33,18 +33,19 @@
.c-bolt-text-v2 {
margin: 0;
padding: 0;
line-height: var(--c-bolt-text-line-height, unset);
letter-spacing: var(--c-bolt-text-letter-spacing, unset);
font: var(--c-bolt-text-font, unset);
font-family: var(--c-bolt-text-font-family, unset);
font-size: var(--c-bolt-text-font-size, unset);
font-weight: var(--c-bolt-text-font-weight, unset);
font-display: swap;

// Font preset
// Font family
@each $family in $bolt-txt-font-family-system {
$family-name: nth($family, 1);

&--#{$family-name} {
--c-bolt-text-font: var(--bolt-txt-preset-#{$family-name}-medium);
--c-bolt-text-font-family: var(--bolt-txt-font-family-#{$family-name});
}
}

Expand Down Expand Up @@ -82,12 +83,18 @@
$size-name: nth($size, 1);

&--font-size-#{$size-name} {
--c-bolt-text-line-height: var(--bolt-txt-line-height-#{$size-name});

&.c-bolt-text-v2--line-height-tight {
line-height: calc(var(--bolt-txt-line-height-#{$size-name}) * 0.77);
--c-bolt-text-line-height: calc(
var(--bolt-txt-line-height-#{$size-name}) * 0.77
);
}

&.c-bolt-text-v2--line-height-loose {
line-height: calc(var(--bolt-txt-line-height-#{$size-name}) * 1.2);
--c-bolt-text-line-height: calc(
var(--bolt-txt-line-height-#{$size-name}) * 1.2
);
}
}
}
Expand Down
Expand Up @@ -97,15 +97,9 @@ $bolt-txt-font-family-system: (
@each $size in $bolt-txt-font-size-system {
$size-name: nth($size, 1);

@each $family in $bolt-txt-font-family-system {
$family-name: nth($family, 1);

--bolt-txt-preset-#{$family-name}-#{$size-name}: var(
--bolt-txt-font-weight-regular
)
var(--bolt-txt-font-size-#{$size-name}) /
var(--bolt-txt-line-height-#{$size-name})
var(--bolt-txt-font-family-#{$family-name});
}
--bolt-txt-preset-headline-#{$size-name}: var(--bolt-txt-font-weight-bold)
var(--bolt-txt-font-size-#{$size-name}) /
var(--bolt-txt-line-height-#{$size-name})
var(--bolt-txt-font-family-headline);
}
}
Expand Up @@ -11,8 +11,8 @@
* calc(var(--bolt-spacing-x) * var(--bolt-spacing-multiplier-medium) * 1em)
*/
$bolt-spacing-system: (
'x': 2,
'y': 1.65,
'x': 1.55,
'y': 1.35,
) !default;

/**
Expand Down

0 comments on commit 1406a3e

Please sign in to comment.