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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Hello, fellow Capsizers. Meet Metrica Typus |
Beta Was this translation helpful? Give feedback.
-
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/
Beta Was this translation helpful? Give feedback.
All reactions