12.0.3 • Published 5 years ago

@fela-next/fela-preset-web v12.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

fela-preset-web

A Fela plugin preset for web applications. It contains everything you need to start building cross-browser compatible apps.

Contains (exact order)

Installation

yarn add fela-preset-web

You may alternatively use npm i --save fela-preset-web.

Usage

Simply use the spread operator to add the preset.

import { createRenderer } from '@fela-next/fela'
import webPreset from '@fela-next/fela-preset-web'

const renderer = createRenderer({
  plugins: [
    ...webPreset,
    // other plugins
  ]
})

Configuration

Some plugins also accept some configuration options. We can use the createWebPreset factory and pass the options using the plugin name as a key.

import { createRenderer } from '@fela-next/fela'
import { createWebPreset } from '@fela-next/fela-preset-web'

const renderer = createRenderer({
  plugins: [
    ...createWebPreset({
      'unit': [
        'em',
        {
          margin: '%'
        }
      ]
    })
  ]
})

License

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