fela-sort-classnames

Fela enhancer to sort classnames in alphabetic order

Usage no npm install needed!

<script type="module">
  import felaSortClassnames from 'https://cdn.skypack.dev/fela-sort-classnames';
</script>

README

fela-sort-classnames

npm version npm downloads Bundlephobia

This enhancer makes sure that the rendered classnames are already ordered alphabetically. This helps to prevent mismatches with React and SSR on Safari due to differences in how objects are iterated.

Installation

yarn add fela-sort-classnames

You may alternatively use npm i --save fela-sort-classnames.

Usage

import { createRenderer } from 'fela'
import sortClassNames from 'fela-sort-classnames'

const renderer = createRenderer({
  enhancers: [ sortClassNames() ]
})

License

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