Dynamic CSS for user interfaces
npm install stylesheet
alt="NPM Version" />
alt="Known Vulnerabilities"
data-canonical-src="https://snyk.io/test/npm/stylesheet"/>
alt='Coverage Status' />
alt="FOSSA Status">
Dynamic CSS for user interfaces.
``bash`
npm install stylesheet
- Pure: Stylesheet uses pure standard CSS. Wrap your dynamic CSS properties with an [attr() function][attr] or [attribute selector] and Stylesheet will automatically update and render them with your data. So you can develop new features in Stylesheet without rewriting existing code.
- Component-Based: Build reusable, customizable and dynamic front-end UI elements. Since components styles is written in plain CSS you can easily define components's complex relationships, interactions and shared styles.
- Write Once, Use Anywhere: Stylesheet can potentially work with any front-end technology stack, so you can share and transfer your styled components between platforms. Stylesheet has official bindings for React and vanilla DOM.
`CSS``
Title {
font-size: 4em;
color: attr(textColor color);
}
#### CSS Modules
A methodology to import CSS tokens (e.g. class names) to JavaScript and converting them to unique identifiers.
- Requires boilerplate code to use as components.
- Does not provide a solution for dynamic CSS.
[attr]: https://github.com/iddan/stylesheet/wiki/attr()
[attribute selector]: https://github.com/iddan/stylesheet/wiki/Attribute-Selector