0.9.0 • Published 5 years ago

indoqa-react-fela v0.9.0

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
5 years ago

indoqa-react-fela

An opinionated starting point we use to include fela in our React projects. It covers:

  • A preconfigured React component that handles createRenderer and mountNode.
  • Theming support by providing a base theme and a function to merge themes.
  • Basic components like Box, Flex and Text.

Usage

To activate the standard preconfigured fela setup, just wrap your application in <IndoqaFela> without any further options:

import React from 'react'
import {render} from 'react-dom'
import {IndoqaFela} from 'indoqa-react-fela'
import DemoApp from './DemoApp.react.js'

const fela = {
  config: {
    plugins: [
      ...presetWeb
    ],
  },
  init: (renderer) => {
    renderer.renderStatic('html, body, #app {height: 100%}')
  },
  resetCss: true,
}

render(
  <IndoqaFela fela={fela}>
    <DemoApp />
  </IndoqaFela>,
  document.getElementById('app')
)

The react-fela <Provider> creates a renderer using the provided config object and adds the css to the HTML head section by lazily adding <style id="fela-stylesheet"> inside <head> with support for hot reloading.

Please not that wrapping <IndoqaFela> around a Redux store might cause problems with hot-reloading because a Redux store must not be recreated.

config

init

  • Get access to the renderer after it is being created.
  • The default value is a nop function.

resetCss

  • If set to true, reset.css is applied as static css to start clean.
  • The default value is true.

Theming

IndoqaFela provides a buildTheme(customTheme) function. The custom theme will be merged with the basic theme using deepmerge.

Demo

This package comes with a simple demo app in src/playground. Use yarn start and point your browser to http://localhost:3000

0.9.2-alpha.10

5 years ago

0.9.2-alpha.9

5 years ago

0.9.2-alpha.7

5 years ago

0.9.2-alpha.6

5 years ago

0.9.2-alpha.5

5 years ago

0.9.2-alpha.4

5 years ago

0.9.2-alpha.3

5 years ago

0.9.2-alpha.2

5 years ago

0.9.1-alpha.1

5 years ago

0.9.0

5 years ago

0.9.0-alpha.14

5 years ago

0.9.0-alpha.13

5 years ago

0.9.0-alpha.12

5 years ago

0.9.0-alpha.11

5 years ago

0.9.0-alpha.10

5 years ago

0.9.0-alpha.9

5 years ago

0.9.0-alpha.8

5 years ago

0.9.0-alpha.7

5 years ago

0.9.0-alpha.6

5 years ago

0.9.0-alpha.5

5 years ago

0.9.0-alpha.4

5 years ago

0.9.0-alpha.3

5 years ago

0.9.0-alpha.2

5 years ago

0.9.0-alpha.1

5 years ago

0.8.0

5 years ago

0.8.0-alpha.1

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

6 years ago

0.7.0-alpha.6

6 years ago

0.7.0-alpha.5

6 years ago

0.7.0-alpha.4

6 years ago

0.7.0-alpha.3

6 years ago

0.7.0-alpha.2

6 years ago

0.7.0-alpha.1

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.6.0-alpha.2

6 years ago

0.6.0-alpha.1

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.4

6 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago