jss-theme-reactor
Powerful theming layer for use with the JSS library (CSS in JS)
Last updated 9 years ago by nmarks .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jss-theme-reactor 
SYNC missed versions from official npm registry.

jss-theme-reactor Build Status codecov npm

Installation

Install jss-theme-reactor.

$ npm install jss-theme-reactor --save

Usage

Basic example

A super simple example demonstrating the basic functionality.

import { create as createJss } from 'jss';
import preset from 'jss-preset-default';
import { createStyleManager, createStyleSheet } from 'jss-theme-reactor';

themeObj = {
  fontFamily: 'Roboto',
  fontSize: 12,
  color: 'red',
};

styleManager = createStyleManager({
  jss: createJss(preset()),
  theme: themeObj,
});

styleSheet = createStyleSheet('button', (theme) => ({
  root: {
    color: theme.color,
    fontSize: theme.fontSize,
    fontFamily: theme.fontFamily,
  },
}));

const classes = styleManager.render(styleSheet);

// classes.root === '.button-root-1l7rpve'

Resulting document head:

<style type="text/css" data-jss="" data-meta="button">
.button-root-1l7rpve {
  color: red;
  font-size: 12px;
  font-family: Roboto;
}
</style>

Current Tags

  • 0.11.1                                ...           latest (9 years ago)

28 Versions

  • 0.11.1                                ...           9 years ago
  • 0.11.0                                ...           9 years ago
  • 0.10.0                                ...           9 years ago
  • 0.9.0                                ...           9 years ago
  • 0.9.0-alpha.1                                ...           9 years ago
  • 0.8.2                                ...           9 years ago
  • 0.8.1                                ...           9 years ago
  • 0.8.0                                ...           9 years ago
  • 0.6.0                                ...           9 years ago
  • 0.5.3                                ...           9 years ago
  • 0.5.2                                ...           9 years ago
  • 0.5.1                                ...           9 years ago
  • 0.5.0                                ...           9 years ago
  • 0.4.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
  • 0.1.0-alpha.14                                ...           10 years ago
  • 0.1.0-alpha.13                                ...           10 years ago
  • 0.1.0-alpha.12                                ...           10 years ago
  • 0.1.0-alpha.11                                ...           10 years ago
  • 0.1.0-alpha.10                                ...           10 years ago
  • 0.1.0-alpha.9                                ...           10 years ago
  • 0.1.0-alpha.8                                ...           10 years ago
  • 0.1.0-alpha.7                                ...           10 years ago
  • 0.1.0-alpha.6                                ...           10 years ago
  • 0.1.0-alpha.5                                ...           10 years ago
  • 0.1.0-alpha.4                                ...           10 years ago
  • 0.1.0-alpha.3                                ...           10 years ago
  • 0.1.0-alpha.2                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 6
Last Month 19
Dependencies (4)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |