Skip to content

Make unknown styles silently be ignored #47

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

Closed
aikar opened this issue Jan 26, 2017 · 4 comments
Closed

Make unknown styles silently be ignored #47

aikar opened this issue Jan 26, 2017 · 4 comments

Comments

@aikar
Copy link

aikar commented Jan 26, 2017

When a class name is missing, it would be better if it simply did not add a class to the class list instead of failing.

This makes it hard to dynamically generate class names when iterating an array to ALLOW for targeting IF needed.

But as it stands now, you would have to define every possible class in the array in the style sheet as it's a hard failure if it doesn't find it.

This doesn't fit with what people expect of CSS.

@bjudson
Copy link

bjudson commented Feb 9, 2017

I disagree. It is useful to quickly discover when you have mistyped a class name, or accidentally put a global className into the styleName prop. One thing I like about this system is that it fits more with what I expect of a module system than what I expect of CSS (global definitions, silent failure).

@bearcott
Copy link

bearcott commented Feb 20, 2017

I agree. When I work, I will often save my html files without the class names first and then add them in later. With this plugin my server will break because of this and I have to restart it every time because its a babel error. This gets very annoying and slows down development a lot.

@aikar
Copy link
Author

aikar commented Feb 20, 2017

@bjudson there could be an option for those who want a hard failure.

Though id like to amend my request to just say add the class naked, no remapping.

Then would be good if this plugin by default added normal AND the modularized version.

@aikar
Copy link
Author

aikar commented Jan 19, 2018

closing as i see you can now reduce missing modules to warnings instead of hard failures.

@aikar aikar closed this as completed Jan 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants