Skip to content
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

how to expose css-classes of features to html? #14

Open
0xgeert opened this issue Apr 5, 2016 · 5 comments
Open

how to expose css-classes of features to html? #14

0xgeert opened this issue Apr 5, 2016 · 5 comments

Comments

@0xgeert
Copy link

0xgeert commented Apr 5, 2016

The standard Modernizr.js sets css classes to html for all the features supported, like touch. This lib does not.

Is there a way to configure this?

@SimenB
Copy link
Contributor

SimenB commented Apr 5, 2016

Have you a added setClasses?

@apreg
Copy link

apreg commented May 1, 2016

For others who land here and not so familiar with Modernizr (like myself), here is a sample how to set this setClasses:

//webpack.config.js
var modernizrConfig = {
   'options': [
       'setClasses'
     ],
    'htmlWebpackPlugin': htmlWebpackPlugin,
    'feature-detects': [
        'css/flexboxlegacy',
        'css/flexbox',
        'forms/placeholder'
    ]
};

I got this information from the Grunt config of the Modernizr's builder page.

@jarodtaylor
Copy link

Adding setClasses didn't do anything for me, either.

@sejenc
Copy link

sejenc commented Mar 16, 2018

To follow up from @jarodtaylor, adding the setClasses string within the options property array in the configuration object does not add any classes to the root html element of the application.

@jaydiablo
Copy link

Adding setClasses as an option did work for me:

In webpack config:

'plugins': [
        new ModernizrWebpackPlugin({
            'options': [
                'setClasses'
            ],
            'feature-detects': [
                'touchevents',
                'storage/localstorage',
                'storage/sessionstorage',
            ]
        })
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants