Enforces object validation for keyframes and rules.
Logs invalid properties to the console
. One might also enable automatic property deletion.
yarn add fela-plugin-validator
You may alternatively use npm i --save fela-plugin-validator
.
Make sure to read the documentation on how to use plugins.
import { createRenderer } from 'fela'
import validator from 'fela-plugin-validator'
const renderer = createRenderer({
plugins: [ validator() ]
})
Option | Value | Default | Description |
---|---|---|---|
logInvalid |
(boolean) | true |
logs invalid properties/values |
deleteInvalid |
(boolean) | false |
deletes invalid properties/values |
import { createRenderer } from 'fela'
import validator from 'fela-plugin-validator'
const validatorPlugin = validator({
logInvalid: true,
deleteInvalid: true
})
const renderer = createRenderer({
plugins: [ validatorPlugin ]
})
If the deleteInvalid
option is enabled.
{
'0%': {
color: 'red'
},
'101%': {
color: 'blue'
},
color: 'blue'
}
{
'0%': {
color: 'red'
}
}
{
color: 'red',
':hover': {
color: 'green',
foo: {
color: 'blue'
}
},
'nested': {
color: 'yellow'
}
}
{
color: 'red',
':hover': {
color: 'green',
}
}
Fela is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @rofrischmann and all the great contributors.