-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting rem as fontSize and lineheight #121
Comments
I am thinking about same thing, and I lean towards CSS |
@LukeFinch I've successfully reimplemended computations in CSS calc, discovered workaround is to pass values as numbers (implied rem), storing as CSS variables and to convert into units only after computation - exactly at the assignment. With this approach CSS-only rem solution is possible: https://jsbin.com/danobedoye/11/edit?html,css,output |
@andriytyurnikov I think it only works in Safari (and now also in Firefox) due to the usage of css
And it will work everywhere. |
@smashercosmo that is an interesting hypothesis, but no. Replacing |
I'm looking into supporting 'rem' as a unit for our design system, and migrating away from pixel values.
Currently, if I want to do that, I have to override the outputs provided from capsize like so:
with arguments as an example:
fontSize: '2rem'
lineHeight: 1.5
Looking into the source code - it seems like pixels are only needed for rounding – I assume if I wanted to use capHeight as a pixel value, and lineGap?
Is there any potential issue with me:
a) passing values in as rem - my assumption is not due to the relative nature of all the calculations
b) overriding the output back to a rem unit?
The text was updated successfully, but these errors were encountered: