-
Notifications
You must be signed in to change notification settings - Fork 402
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
What about css class dynamically added by some javascript ? #5
Comments
Hi, Uncss will delete the class from the css file if it's not in the html file.
|
As @Tobino said, for now you can use the ignore option. |
Hey @giakki. Do you know what the status is of the Phantom integration? Thinking about moving it to master in the future? |
Hey! I rewrote it from scratch, and it looks pretty good! |
Hello, Maybe this will look as a support request. I use jQuery UI (modal), the "dismissable" functionality stopped working. Also this: http://mynameismatthieu.com/WOW/ stopped working. To find the selectors that are being removed I inspect the HTML elements (Chrome Developer tools) finding the CSS style tab and compare the full CSS against the uncss version. However for this two libraries I was unable to find any difference using this method. Is there a better way to detect the missing CSS that are affecting the functionality of the website? |
Just thinking aloud, why not simply to have the option to pass/parse a JS file for any mention of CSS classes ie- make it detect and include the CSS class in this example:
Where myscript.js has say 300 lines of code, with one such line being:
and as such, You wouldn't need any JS logic specifically; just cross reference any ".class-names" with what is in the source CSS files and if there is a match include it; otherwise don't include it; ie- it's not CSS; avoid false negatives |
@drschwabe That's easier said than done without any false positives. https://github.com/purifycss/purifycss does something similar to this. Locking to avoid further noise on this thread, notifying all the earlier participants. |
If in my JS, i have:
How will it be interpreted by uncss ?
The text was updated successfully, but these errors were encountered: