Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
className prefix is not applied when removing "no-js" classname #1031
The className prefix option is used to prefix the default Modernizr classnames. I am using a prefix of "supports", so I have classes like "supports-js", "supports-no-js", "supports-flexbox" and "supports-no-touch" for my feature detection classnames.
I have added a classname of "supports-no-js" to my HTML element, but Modernizr does not remove this. Modernizr has been hardcoded to remove a classname of "no-js" only, disregarding the className prefix option:
This is a feature request to apply the className prefix option when removing the "no-js" className.
Sure, its in this case, I think that no-js is clearer. A positive-negative makes it sound clunkier.
Personal preference is all.
Regardless, this is technically an issue with the builder, rather than the detects themselves. I'll be messing with this over at Modernizr/modernizr.com, and will ping you with any update.
I think it should remove both prefixed and non-prefixed
Otherwise, I think it could cause problems if e.g. using HTML5 Boilerplate with className prefix
@patrickkettner – this is an issue with Modernizr (rather than modernizr.com), as this repo includes the code which applies the
If I use the build function from the site this doesn't seem to be solved:
I can't use
pushed a commit
Feb 22, 2015
When using Modenizr with a class prefix, .no-js was not getting removed. I could fix it by adding the correct prefix to .no-js in my html, however I wanted it to retain its original behaviour, and have either .no-js or .js class on the html (mainly because some third party libraries make use of these classes)
So I replaced