Open jonathan-s opened 4 years ago
Interesting idea @jonathan-s. Do you have any idea for what the API could be like?
For font-size specifically it would be nice to be able to use a function.
theme: {
fontSize: calculateGoldenRatio(1.6)
...
}
The output would be.
xs: '0.97rem',
sm: '1.25rem',
base: '1.6rem',
lg: '2rem',
xl: '2.6rem',
'2xl': '3.3rem',
'3xl': '4.2rem',
'4xl': '5.3rem',
'5xl': '6.7rem',
'6xl': '8.4rem',
If no function is provided the base is assumed to be 1 rem. Though my preference for the standard case would be 1.6rem
. That coupled with html { font-size: 62.5% }
would mean that 1rem
is always equal to 10px which helps if you size things in other places in rem.
I haven't yet given much though for the margin stuff that is also included in the calculator.
I'd consider implementing golden ratio typography as detailed here: https://grtcalculator.com/