fela-plugin-remove-undefined

v5.0.21
Fela plugin to remove invalid undefined values
fela fela-plugin cssinjs

Deprecated!
The remove undefined plugin (fela-plugin-remove-undefined) is deprecated, please remove it from your Fela configuration.
Fela automatically removes 'undefined' values making this plugin obsolete.

fela-plugin-remove-undefined

npm version npm downloads

Removes any undefined value or string values containing undefined. It also checks array values. This plugin has been used to ensure auto prefixing to work. It is not necessary anymore as Fela automatically strips all undefined values.

Installation

yarn add fela-plugin-remove-undefined

You may alternatively use npm i --save fela-plugin-remove-undefined.

Usage

Make sure to read the documentation on how to use plugins.

import { createRenderer } from 'fela'
import removeUndefined from 'fela-plugin-remove-undefined'

const renderer = createRenderer({
  plugins: [ removeUndefined() ]
})

Example

Input

{
  color: 'blue',
  fontSize: undefined,
  border: 'undefinedpx solid blue',
  ':hover': {
    color: [ 'rgba(0, 0, 0, 0.4)', undefined, 'black' ]
  }
}

Output

{
  color: 'blue',
  ':hover': {
    color: [ 'rgba(0, 0, 0, 0.4)', 'black' ]
  }
}

License

Fela is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @rofrischmann and all the great contributors.

npm i fela-plugin-remove-undefined

Metadata

  • MIT
  • Whatever
  • Robin Frischmann
  • released 7/5/2018

Downloads