hipstersmoothie / storybook-dark-mode

A storybook addon that lets your users toggle between dark and light mode.
MIT License
428 stars 56 forks source link

support adding multiple classes #237

Closed unional closed 1 year ago

unional commented 1 year ago

The following causes error: DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('host-dark app-dark') contains HTML space characters, which are not valid in tokens.

darkMode: {
    current: 'host-dark app-dark', // initial mode
    darkClass: 'host-dark app-dark',
    stylePreview: true
}

We need this because we are working on MFE and each MFE using a different tailwind prefix (app1, app2, etc).

hipstersmoothie commented 1 year ago

If you want to make a PR to fix I'd be happy to merge

unional commented 1 year ago

It's actually support now that we can do darkClass: ['host-dark', app-dark']