fela-beautifier

12.2.1 • Public • Published

fela-beautifier

Deprecated: This package is deprecated since we no longer render CSS to textContent in devMode but use insertRule all the way. It will be removed with the next major version release.

npm version npm downloads Bundlephobia

The beautifier enhancer is a developer tool that automatically formats the rendered CSS markup on every change. It uses cssbeautify to achieve this.

Installation

yarn add fela-beautifier

You may alternatively use npm i --save fela-beautifier.

Usage

import { createRenderer } from 'fela'
import beautifier from 'fela-beautifier'

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

Configuration

Options

Uses the same options as cssbeautify does.

Option Value Default Description
ident (string) (2 spaces) a string used for the indentation of the declaration
openbrace end-of-line, separate-line end-of-line placement of open curly brace
autosemicolon (boolean) false insert semicolon after the last rule
Example
import { createRenderer } from 'fela'
import beautifier from 'fela-beautifier'

const beautifyEnhancer = beautifier({
  openbrace: 'separate-line',
  autosemicolon: 'false',
  ident: '  ',
})

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

Example

Preview

License

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

Versions

Current Tags

Version History

Package Sidebar

Install

npm i fela-beautifier

Weekly Downloads

3,575

Version

12.2.1

License

MIT

Unpacked Size

14.7 kB

Total Files

6

Last publish

Collaborators

  • rofrischmann
  • txhawks