Only one class added to html tag
uturnr opened this issue · 9 comments
If I run customizr from the command line, or from grunt-modernizr, I get a Modernizr 3.7.0 custom build with the reference URL: https://modernizr.com/download/?-arrow-contains-csstransforms3d-ellipsis-flexbox-flexboxlegacy-hidden-opacity-sizes-srcset-supports-svg-target-template-time-addtest-fnbind-printshiv-testprop
When I include this build in an html page, only the sizes
class ends up added to my html
tag. Using the modernizr.com builder works properly (it provides a Modernizr 3.6.0 custom build).
hi @uturnr when using the 3.7 custom build do any errors appear on your browser console?
Hi @rejas, No errors. When I read the Modernizr
object in Chrome, it contains:
arrow: true
contains: false
csstransforms3d: true
ellipsis: true
flexbox: true
flexboxlegacy: true
hidden: true
opacity: true
sizes: true
srcset: true
supports: true
svg: true
target: true
template: true
time: false
I've turned off uglify and made a gist of the build I'm experiencing the issue with:
https://gist.github.com/uturnr/550903bc857026a814aa95724e26bda7
can indeed reproduce it with your gist... can you post your config you are using it to build this?
Observation: Tests via addAsyncTest are added correctly to the html tag, tests via addTest not (sizes is the only async test in your config) (created via grunt and latest modernizr)
Ok, so just add "setClasses" to your list of options when building Modernizr that should enable ALL html tags again.
Not sure if it is a bug in 3.6 that they are added even if the option is not set or if it is a bug in 3.7 (by not documenting it enough or just being a bug :-) Anyway, please try that oin your side and report back ;-)
Thanks, that works! I had no options declared, based on the wording of the readme (A sample config file is below. Default values shown:
) I thought these 4 options would be on by default:
"options" : [
"setClasses",
"addTest",
"html5printshiv",
"testProp"
],
Thanks for the help!
hi @uturnr I created a branch with a fix that enables setClasses by default. Could you confirm that this fix would work for your old config too?
Hey @rejas, yes - when using that branch setClasses is on by default with my old config (no options declared in settings). :)
Closing it then :-)