rofrischmann/fela

View on GitHub
website/docs/11.7.0/extra/faq.mdx

Summary

Maintainability
Test Coverage
# FAQ

## Table of contents

- [Can I use it together with CSS files?](#can-i-use-it-together-with-css-files)
- [Can I use it together with inline styles?](#can-i-use-it-together-with-inline-styles)
- [Can I use it without React?](#can-i-use-it-without-react)
- [Can I use it with React Native?](#can-i-use-it-with-react-native)
- [Can I use template strings?](#can-i-use-template-strings)
- [Can I use objects instead of functions?](#can-i-use-objects-instead-of-functions)
- [Is Fela production-ready?](#is-fela-production-ready)
- [Where does the name "Fela" come from?](#where-does-the-name-fela-come-from)

---

## Can I use it together with CSS Files?

**Yes**. Fela is encapsulated and can be integrated into any kind of application and therefore can also be used together with other CSS files/classes.<br />
Just remember that you might again get into specificity problems if you mix different CSS classes from different sources.

## Can I use it together with inline styles?

**Yes**. You can always use inline styles together with Fela. It can be useful to overwrite single values for specific cases. Also state-depending styles might better fit as inline styles e.g. a progress bar which updates the inner width according to the progress. This might else lead to >100 rendered Fela classes.

## Can I use it without React?

**Yes**. Fela is framework-agnostic by design, but works especially well with React and React-like view libraries. Checkout the official React bindings [react-fela](https://github.com/robinweser/fela/tree/master/packages/react-fela) as well as [Usage with React](guides/usage-with-react).<br />
It also works great with [Inferno](guides/usage-with-inferno), [Preact](guides/usage-with-preact), [ReasonML](guides/usage-with-reasonml), [Vue](https://github.com/houd1ni/fela-vue), [Vue alternative](https://github.com/wagerfield/vue-fela), [Hyper](https://github.com/ahdinosaur/hyper-fela) and [Cycle](guides/usage-with-cycle).

## Can I use it with React Native?

**Yes**. Next to React, Fela also supports React Native. It can also be used with [react-fela](https://github.com/robinweser/fela/tree/master/packages/react-fela) and shares a similar API with [fela](https://github.com/robinweser/fela/tree/master/packages/fela) itself. You just have to replace your `createRenderer`-method with the one exported by [fela-native](https://github.com/robinweser/fela/tree/master/packages/fela-native). Check out [Usage with React Native](guides/usage-with-react-native) for more information.

## Can I use template strings?

**Yes**. While you traditionally write your Fela styles in JavaScript object notation, there are several tools that allow styles written in pure CSS using [ECMAScript 2015 template strings](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/template_strings). You may try [react-styling](https://github.com/halt-hammerzeit/react-styling) for runtime transformation or even use [babel-plugin-css-in-js](https://github.com/jakecoxon/babel-plugin-css-to-js) which was in particular written for Fela rules.

## Can I use objects instead of functions?

With pure Fela: **No**. Except for static styles rendered using [`renderer.renderStatic`](api/fela/renderer#renderstaticstyle).<br />Read about our [Principles](intro/principles) to learn why!<br />
That said, if you're working with bindings such as [react-fela](https://github.com/robinweser/fela/tree/master/packages/react-fela), most APIs also accept [style objects](basics/rules#style-static) directly.

## Is Fela production-ready?

**Yes**. As of version 1.0.0 Fela is production-ready and fully covered with tests.<br />
It is already used in many applications in production.

## Where does the name "Fela" come from?

Fela actually is the name of a character in one of the author's favorite fantasy novel called ["Kingslayer Chronicles"](https://en.wikipedia.org/wiki/The_Kingkiller_Chronicle) by [Patrick Rothfuss](http://www.patrickrothfuss.com/content/index.asp). [Fela](http://kingkiller.wikia.com/wiki/Fela) is a young, attractive and smart woman practicing sculpturing among others at the university of Imre. She's one of [Kvothe](http://kingkiller.wikia.com/wiki/Kvothe)'s (the main protagonist), best friends there.<br />
There is no deep connection to JavaScript styling in general, except the fact that she does sculpturing which seems to be kind of similar to what component styling is lately.