The style middleware
The style
middleware is responsible for dynamic styling.
- name: style
- middleware dependencies: attributes
- all middleware dependencies: observe, attributes
- processes: element nodes
- throws on: nothing
- use as: component or content middleware
- docs
Installation
npm install @nx-js/style-middleware
Usage
const component = require('@nx-js/core')
const observe = require('@nx-js/observe-middleware')
const attributes = require('@nx-js/attributes-middleware')
const style = require('@nx-js/style-middleware')
component()
.useOnContent(observe)
.useOnContent(attributes)
.useOnContent(style)
.register('stylish-comp')
<stylish-comp>
<div @class="{big: true, outlined: shouldOutline}"></div>
</stylish-comp>