Skip to content

Add more stylesheet units for the length regex #35

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

Conversation

markusguenther
Copy link

Add px, pt, em, ex and pc as CSS units to detect the length. Otherwise a
pt value for instance can not be transformed.

I used the library without styled components and transform css for an htmlview. Then you can have other css units like points.

Add px, pt, em, ex and pc as CSS units to detect the length. Otherwise a
pt value for instance can not be transformed.
@jacobp100
Copy link
Contributor

jacobp100 commented Apr 12, 2017

I’m not opposed to adding some of these, although currently 1pt == 1px (it should be about 1.333px).

I'm not 100% sure on adding units that depend on the current font size, since they won't work as expected—but we might be able to get away with rem.

@markusguenther
Copy link
Author

I am nut sure if the library transforms pt to pixels. I got an error in my app because the pt was not transformed and react-native could not handle it. The other formats was just an addition.

@jacobp100
Copy link
Contributor

You’ll need to get it to transform units to the pixel values. You can look at the CSS values spec for the conversions! In addition, if you wanted rem, you can do that based off a font size of 14px.

@markusguenther
Copy link
Author

I adjusted my package now. So if this is not a general issue I close the PR.

Thanks for the fast feedback 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants