Currently, I am experimenting with Modernizr for the first time and facing some challenges in adding a class to the HTML tag as per the documentation.
To check compatibility for the CSS Object Fit property, I used Modernizr's build feature to create a customized js file named modernizr-custom.js
. This file was then added to my Javascript directory and loaded through Gulp in my gulpfile. However, upon refreshing the page and inspecting it using Chrome dev tools, I noticed that the HTML tag now has an empty class: class=""
instead of class="object-fit"
. It appears that Modernizr is functioning to some extent but not correctly.
In my root directory, I have a file named modernizr-config.json
which is configured as follows:
{
"minify": true,
"options": [
"setClasses"
],
"feature-detects": [
"css/objectfit"
]
}
I'm unsure if there are any additional Modernizr js files that need to be included for this setup to function properly. Any guidance on this matter would be greatly appreciated, as I believe there might be something crucial that I'm missing in setting it up.