The Modernizr custom builder has the ability to prefix the <html> classes with a custom string. It should be pretty easy to provide this config option in the admin UI so I'm filing this issue as a to-do.

Comments

johnalbin’s picture

I found this Modernizr._config.classPrefix buried in https://github.com/Modernizr/Modernizr/blob/master/src/addTest.js

I was trying to find docs or rationale behind it, but only found this issue via Google since d.o's google-fu is so powerful. :-)

It looks like if the prefix was set to 'has-', then the classes would be has-FEATURE and has-no-FEATURE

rupl’s picture

That is correct. It's pretty much the only purpose of the CSS prefix. Clever example!

Think of it like the Drupal DB table name prefix. It's there to provide a namespace of sorts.

rupl’s picture

Other services prefix their JavaScript-controlled <html> classes as well. For example, Typekit often generates wf- prefixes.