How to use the react-jss.createTheming function in react-jss

To help you get started, we’ve selected a few react-jss examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / react-jss_v7.x.x / test_react-jss_v7.x.x.js View on Github external
// No error
 {}} />;

const ThemedButtonClassComponent = withTheme(ButtonClassComponent);

// $ExpectError - missing prop "onClick"
;

// No errors
 {}} />;

// ===================================
// createTheming
// ===================================

createTheming('__MY_THEME__');
github rambler-digital-solutions / rambler-ui / src / theme / index.js View on Github external
JssProvider,
  SheetsRegistry
} from 'react-jss'
import preset from 'jss-preset-default'
import base from /* preval */ './base'
import uuid from '../utils/uuid'

const RAMBLER_UI_THEME = '__RAMBLER_UI_THEME__'
const RAMBLER_UI_JSS = '__RAMBLER_UI_JSS__'
const RAMBLER_UI_SHEETS_REGISTRY = '__RAMBLER_UI_SHEETS_REGISTRY__'
const RAMBLER_UI_THEME_COUNTER = '__RAMBLER_UI_THEME_COUNTER__'
const RAMBLER_UI_CLASS_NAME_PREFIX = '__RAMBLER_UI_CLASS_NAME_PREFIX__'

const ruiPrefix = 'rui-'

const theming = createTheming(RAMBLER_UI_THEME)
const {ThemeProvider, withTheme} = theming

export {withTheme}

export const createJss = (options = {}) =>
  originalCreateJss({
    ...preset(options),
    ...options
  })

export const createSheetsRegistry = () => new SheetsRegistry()

export const globalSheetsRegistry = createSheetsRegistry()
export const globalJss = createJss()

export const createGenerateClassName = (themeId = 0) => {
github rambler-digital-solutions / rambler-ui / docs / utils / theming.js View on Github external
export const theme = {
  colors: {
    blue: '#315efb',
    alternativeBlue: '#649dff',
    dark: '#2b2c2d',
    light: '#ffffff',
    red: '#f85656',
    black: '#262626',
    carbone: '#343b4c',
    cloudGray: '#8d96b2',
    argentum: '#e5eaee',
    argentumLight: '#eef2f4'
  }
}

const theming = createTheming('UI_DOCS_THEME')
const {ThemeProvider: Provider, withTheme} = theming

export {withTheme}

export const ThemeProvider = ({children}) => (
  {children}
)

export default styles => injectSheet(styles, {theming})