Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
More API tightening.tar.gz | 2016-09-22 | 566.0 kB | |
More API tightening.zip | 2016-09-22 | 658.4 kB | |
README.md | 2016-09-22 | 662 Bytes | |
Totals: 3 Items | 1.2 MB | 0 |
The helper function awkwardly known as adjustFontSizeToMS
is now simply scale
which nicely parallels the other commonly used Typography.js helper function rhythm
.
scale
is used to scale font sizes. When called it returns an object with calculated values for fontSize
and lineHeight
e.g.
:::javascript
scale(1) // => { fontSize: '1.51572rem', lineHeight: '2.25rem' }
This makes it easy to adjust the size of elements when using inline styles or css-in-js.
E.g. <div style={{...scale(1)}}</div>
To calibrate your understanding of scale values. A scale value of 0 is the size of the body font. A value of 1 is the (default) size of h1s.