Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nathanmarks/jss-theme-reactor

NOT MAINTAINED Powerful theming layer for use with the jss CSS in JS library
https://github.com/nathanmarks/jss-theme-reactor

Last synced: 8 days ago
JSON representation

NOT MAINTAINED Powerful theming layer for use with the jss CSS in JS library

Awesome Lists containing this project

README

        

# jss-theme-reactor [![Build Status](https://img.shields.io/circleci/project/nathanmarks/jss-theme-reactor/master.svg?style=flat-square)](https://circleci.com/gh/nathanmarks/jss-theme-reactor) [![codecov](https://codecov.io/gh/nathanmarks/jss-theme-reactor/branch/master/graph/badge.svg)](https://codecov.io/gh/nathanmarks/jss-theme-reactor) [![npm](https://img.shields.io/npm/v/jss-theme-reactor.svg?style=flat-square)](https://www.npmjs.com/package/jss-theme-reactor)

## NOT MAINTAINED!

## Installation

Install `jss-theme-reactor`.

```bash
$ npm install jss-theme-reactor --save
```

## Usage

- [Basic example](#basic-example)

### Basic example

A super simple example demonstrating the basic functionality.

```javascript
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-tr-1'
```

Resulting document head:

```html

.button-root-tr-1 {
color: red;
font-size: 12px;
font-family: Roboto;
}

```