rems possible? #38
Replies: 4 comments 2 replies
|
I used rems in tailwind-baseline (https://github.com/apkoponen/tailwind-baseline/blob/master/src/utils.js) based on the old basekick (https://github.com/michaeltaranto/basekick) calculations, but I'm not 100% sure this works correctly in all cases. At least some rounding errors might occur. Interested in this too. |
|
Just cleaning up ready for publishing and also adding support for fontSize input. There have been a number of improvements and refinements to the algorithm this week. Once the dust settles, I am curious to investigate em/rem and/or unitless line heights. |
|
Example CSS only example of rems - this demo only works in Safari (due to Chrome limits on calc() nesting) https://jsbin.com/danobedoye/11/edit?html,css,output I have prototype which works in Chrome too, but it would require more CSS variables. Partially-computed values injected as CSS variables, and later applied via utility class. You may see it at https://andriytyurnikov.github.io/ Here is the postcss code of working draft implementation https://github.com/andriytyurnikov/andriytyurnikov.github.io/blob/main/src/pro-rem.css While I've planned to release tailwind plugin, I got carried away by other stuff - feel welcome to borrow from repo. |
|
Hello, fellow Capsizers. Meet Metrica Typus |
Uh oh!
There was an error while loading. Please reload this page.
Given that there can be accessibility issues of setting font sizes by px. Can this hold up with returning rems instead of px values?
More info: https://css-tricks.com/is-it-better-to-use-ems-rems-than-px-for-font-size/
All reactions