fela-plugin-kebab-case

Fela plugin to normalize kebab-case properties

Usage no npm install needed!

<script type="module">
  import felaPluginKebabCase from 'https://cdn.skypack.dev/fela-plugin-kebab-case';
</script>

README

fela-plugin-kebab-case

npm version npm downloads Bundlephobia

Note: We recommend writing your styles as camel-case properties in general. This conforms with the JavaScript APIs and is also more convenient to write.

Normalized all kebab-case properties into camel-case properties that Fela requires.

Installation

yarn add fela-plugin-kebab-case

You may alternatively use npm i --save fela-plugin-kebab-case.

Usage

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

import { createRenderer } from 'fela'
import kebabCase from 'fela-plugin-kebab-case'

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

Example

Input

{
  color: 'blue',
  'background-color': 'red'
}

Output

{
  color: 'blue',
  backgroundColor: 'red'
}

License

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