Replies: 2 comments 1 reply
|
We list the typescale tokens in our typography doc. There is not a pre-compiled CSS or Lit stylesheet that has these tokens for usage in CSS yet, but we're working on it in #1050 this year! In the meantime, you can use Sass to compile the tokens to a CSS stylesheet yourself to use. Create a Sass file... // my-stylesheet.scss
@use '@material/web/typography/typescale';
@use '@material/web/tokens';
:root {
// Emit --md-sys-typescale-* tokens to use in your own CSS
@include typescale.theme(tokens.md-sys-typescale-values());
}
// You can now reference properties in your CSS
.my-display {
font-family: var(--md-sys-typescale-display-medium-font);
}...then download MWC and Sass to compile it... npm install @material/web sass
npx sass --load-path=node_modules my-stylesheet.scss my-stylesheet.css...and use the resulting CSS stylesheet. :root {
--md-sys-typescale-display-medium-font: var(--md-ref-typeface-brand, Roboto);
}
.my-display {
font-family: var(--md-sys-typescale-display-medium-font);
}
|
0 replies
|
Compiling with dart sass I get the following: But |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
May I ask if there is a compiled version of the typescale tokens for Vanilla CSS users? If no, is there a plan to output a list of CSS Custom Properties for all these tokens?
Thanks in advance.
All reactions