Skip to content

Commit

Permalink
feat(tokens): add utility-class to typography
Browse files Browse the repository at this point in the history
  • Loading branch information
felipefialho committed Mar 28, 2023
1 parent 300923a commit 0cbd725
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/tokens/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import autoprefixer from 'autoprefixer'
import postcss from 'rollup-plugin-postcss'

export default {
input: 'src/tokens.scss',
input: 'src/index.scss',
output: [
{
file: `dist/tokens.css`
file: `dist/styles.css`
},
],
plugins: [
Expand Down
3 changes: 3 additions & 0 deletions packages/tokens/src/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import 'tokens';
@import 'typography';

29 changes: 29 additions & 0 deletions packages/tokens/src/typography.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@mixin typography-generator($variable-name) {
.jsm-#{$variable-name} {
font: var(--#{$variable-name});
letter-spacing: var(--#{$variable-name}-letter);
}
}

@include typography-generator('title-giant');
@include typography-generator('title-display');
@include typography-generator('title-headline-xxlarge');
@include typography-generator('title-headline-xlarge');
@include typography-generator('title-headline-large');
@include typography-generator('title-headline-medium');
@include typography-generator('title-headline-small');
@include typography-generator('title-headline-xsmall');
@include typography-generator('text-subtitle-large');
@include typography-generator('text-subtitle-medium');
@include typography-generator('text-body-large');
@include typography-generator('text-body-medium');
@include typography-generator('text-body-small');
@include typography-generator('text-link-large');
@include typography-generator('text-link-medium');
@include typography-generator('text-link-small');
@include typography-generator('button-large');
@include typography-generator('button-medium');
@include typography-generator('text-caption');
@include typography-generator('text-caption-focused');
@include typography-generator('text-overline');
@include typography-generator('text-badge');

0 comments on commit 0cbd725

Please sign in to comment.