_typography.scss
ASCII text
1// Based on: 2// https://material.io/design/typography/the-type-system.html 3 4@use "../../theme"; 5 6$font-family: "M+ 1c", Roboto, Cantarell, Sans-Serif; 7 8$_rem: 14px; 9$_subtitle-size: 16px; 10 11@if theme.$compact { 12$_rem: 14px; // or should be 13px? 13$_subtitle-size: 15px; 14} 15 16// provide font size in pt, with px fallback 17@function _pt($size) { 18@return ($size * .75 / 1px) * 1pt; 19} 20 21// provide icon size in em, with px fallback 22@function icon-size($size: 16px) { 23@return ($size / $_rem) * 1em; 24} 25 26@mixin headline1 { 27font-size: 96px; 28font-weight: 300; 29// line-height: 1; 30} 31 32@mixin headline2 { 33font-size: 60px; 34font-weight: 300; 35// line-height: 1; 36} 37 38@mixin headline3 { 39font-size: 48px; 40font-weight: 400; 41// line-height: 50px; 42} 43 44@mixin headline4 { 45font-size: 34px; 46font-weight: 400; 47// line-height: 40px; 48} 49 50@mixin headline5 { 51font-size: _pt(24px); 52font-weight: 400; 53// line-height: 32px; 54} 55 56@mixin headline6 { 57font-size: _pt(20px); 58font-weight: 500; 59// line-height: 32px; 60} 61 62@mixin subtitle1 { 63font-size: _pt($_subtitle-size); 64font-weight: 400; 65// line-height: 28px; 66} 67 68@mixin subtitle2 { 69font-size: _pt($_rem); 70font-weight: 500; 71// line-height: 22px; 72} 73 74@mixin body1 { 75font-size: _pt($_subtitle-size); 76font-weight: 400; 77// line-height: 24px; 78} 79 80@mixin body2 { 81font-size: _pt($_rem); 82font-weight: 400; 83// line-height: 20px; 84} 85 86@mixin caption { 87font-size: _pt(12px); 88font-weight: 400; 89// line-height: 20px; 90} 91 92@mixin button { 93font-size: _pt($_rem); 94font-weight: 500; 95// line-height: 36px; 96} 97 98@mixin overline { 99font-size: _pt(12px); 100font-weight: 400; 101// line-height: 32px; 102} 103