Skip to content
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

Likelihood of working with CSS injected with React + CSS Modules? #99

Open
brandondurham opened this issue May 30, 2018 · 4 comments
Open
Labels

Comments

@brandondurham
Copy link

My CSS is injected as style tags with React and using CSS Modules. I don’t want all CSS processed with viewport-units-buggyfill. I saw the tip to add data-viewport-units-buggyfill="ignore" to the <link /> tag which made me believe that injected CSS wouldn’t be supported, but I didn’t see mention of it.

Possible?

@rodneyrehm
Copy link
Owner

<style data-viewport-units-buggyfill="ignore"> should work as well, if I'm reading this right. Does that answer your question?

@marcoribeiroweb
Copy link

I see the point and i think have the same issue, but im not using React or something, i just use CSS and i dont want all CSS being processed by viewport-units-buggyfill, just want a specific elements. Your tip <style data-viewport-units-buggyfill="ignore"> doesnt work if you only have just one style css. Is there any way to prevent this? Tell to buggyfill to apply style elements just to a specific elements? @rodneyrehm

@rodneyrehm
Copy link
Owner

@marcoribeiroweb sounds like you want to "select selectors"? the buggyfill doesn't support that and I'm not sure how we'd even go about providing such a feature. Weird hacks like html:not(.viewport-units-buggyfill-ignore) <your actual selector> to exclude (or inverse to include) come to mind, but I don't know how big of a pandora's box that would be.

@marcoribeiroweb
Copy link

Hmm, yes maybe. But is would be awesome if there is a workaround.
If there is not, for me it comes to mind that the only way to do this without weird hacks is to work with 2 css styles, one with only all VW/VH units that i want viewport-units-buggyfill work and the other with the data-viewport-units-buggyfill attribute to ignore.
Thank you.

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

No branches or pull requests

3 participants