Skip to content

jtberglund/react-themable-hoc-jss-interface

Repository files navigation

react-themable-hoc-jss-interface

Allows JSS to be used with react-themable-hoc

npm install --save react-themable-hoc-jss-interface

Usage

import JSSInterface from 'react-themable-hoc-jss-interface';
import { ThemeManager } from 'react-themable-hoc';
import jss from 'jss';

// Make sure to setup JSS
jss.setup(preset());

// Create JSSInterface and add to the ThemeManager
const jssInterface = new JSSInterface();
ThemeManager.setStyleInterface(jssInterface);
ThemeManager.addTheme('theme1', {
    // theme styles
});

To use custom jss plugins, simply pass your custom JSS to the JSSInterface constructor

import JSSInterface from 'react-themable-hoc-jss-interface';
import jss from 'jss';
import camelCase from 'jss-camel-case';

// Setup jss with plugins
jss.use(camelCase());

const jssInterface = new JSSInterface(jss);

License

MIT