Typography
Predefined typographies
Display-4
Display-3
Display-2
Display-1
Headline
Title
Subhead
Body-2
Body-1
Body-2-force-preferred-font
Body-1-force-preferred-font
Caption
Caption-force-preferred-font
Display-4
Display-3
Display-2
Display-1
Headline
Title
Subhead
Body-2
Body-1
Body-2-force-preferred-font
Body-1-force-preferred-font
Caption
Caption-force-preferred-font
Typographies
Color contrast
html div
mdlTypographyTextJustify;
with:
[ #('display-4' 'display-3' 'display-2' 'display-1' 'headline' 'title' 'subhead' 'body-2' 'body-1' 'body-2-Force-Preferred-Font' 'body-1-Force-Preferred-Font' 'caption' 'caption-Force-Preferred-Font' 'menu' 'button')
do: [ :each |
| selector |
selector := ('mdlTypography' , (each capitalized copyReplaceAll: '-' with: '' )) asSymbol. "For example `#mdlTypographyCaptionForcePreferredFont`"
html div
style: 'margin: 10px 0;';
perform: selector;
with: each asLowercase capitalized ] ] html div
mdlTypographyTextJustify;
with:
[ #('display-4' 'display-3' 'display-2' 'display-1' 'headline' 'title' 'subhead' 'body-2' 'body-1' 'body-2-Force-Preferred-Font' 'body-1-Force-Preferred-Font' 'caption' 'caption-Force-Preferred-Font' 'menu' 'button')
do: [ :each |
| selector |
selector := ('mdlTypography' , (each capitalized copyReplaceAll: '-' with: '' ), 'ColorContrast') asSymbol. "For example `#mdlTypographyCaptionForcePreferredFontColorContrast`"
html div
style: 'margin: 10px 0;';
perform: selector;
with: each asLowercase capitalized ] ]This is am example with the font option: thin
This is am example with the font option: light
This is am example with the font option: regular
This is am example with the font option: medium
This is am example with the font option: bold
This is am example with the font option: black
Font options
html div
mdlTypographyTextJustify;
mdlTypographyBody2;
style: 'width: 400px;';
with: [ #('thin' 'light' 'regular' 'medium' 'bold' 'black')
do: [ :each |
| selector |
selector := ('mdlTypographyFont' , each capitalized) asSymbol. "For example `#mdlTypographyFontThin`"
html div
perform: selector;
with: 'This is am example with the font option: ' , each ] ]This is am example with the text option: left
This is am example with the text option: right
This is am example with the text option: center
This is am example with the text option: justify
This is am example with the text option: nowrap
This is am example with the text option: lowercase
This is am example with the text option: uppercase
This is am example with the text option: capitalize
Text options
html div
mdlTypographyTextJustify;
mdlTypographyBody1;
with: [ #('left' 'right' 'center' 'justify' 'nowrap' 'lowercase' 'uppercase' 'capitalize')
do: [ :each |
| selector |
selector := ('mdlTypographyText' , each capitalized) asSymbol. "For example `#mdlTypographyTextLeft`"
html div
perform: selector;
with: 'This is am example with the text option: ' , each ] ]Primary
Primary-dark
Accent
Background color options
html div
mdlTypographyTextJustify;
style: 'color: white; width: 400px;';
with:
[ #('primary' 'primary-Dark' 'accent')
do: [ :each |
| selector |
selector := ('mdlBackgroundColor' , (each capitalized copyReplaceAll: '-' with: '' )) asSymbol. "For example `#mdlBackgroundColorPrimaryDark`"
html div
style: 'margin: 10px 0;';
perform: selector;
with: each asLowercase capitalized ] ]Primary
Primary-dark
Accent
Text color options
html div
mdlTypographyTextJustify;
with:
[ #('primary' 'primary-Dark' 'accent')
do: [ :each |
| selector |
selector := ('mdlTextColor' , (each capitalized copyReplaceAll: '-' with: '' )) asSymbol. "For example `#mdlTextColorPrimaryDark`"
html div
style: 'margin: 10px 0;';
perform: selector;
with: each asLowercase capitalized ] ]