styletron-legacy
v2.6.1
Published
Legacy package for 1.x styletron
Downloads
5
Readme
styletron
A generic server-rendering helper for css-in-js tools
This module provides functionality for:
- Injection of CSS into the document head in browsers
- Buffering of multiple injections into a single update
- Ignoring of duplicate style injections
- Extraction of CSS at render-time on the server, which can be sent down along with markup
This concept behind this module is originally from https://github.com/Khan/aphrodite, but this module is smaller in scope and more generic.
Usage
Injecting a style into document <head>
const styletron = require('styletron');
styletron.injectOnce('.foo { color: red }', 'someUniqueId');
Extracting "injected" CSS at render-time on the server
See styletron-server