Browse Source
Updated FAQ
Added a note that CSS-in-JS is not mandatory adn How to import css files.
main
Yash Joshi
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
content/docs/faq-styling.md
|
|
@ -8,6 +8,12 @@ category: FAQ |
|
|
|
|
|
|
|
### How do I add CSS classes to components? |
|
|
|
|
|
|
|
Import the CSS file in which the styles are scoped: |
|
|
|
|
|
|
|
```jsx |
|
|
|
import from './path/to/Filename.css'; |
|
|
|
``` |
|
|
|
|
|
|
|
Pass a string as the `className` prop: |
|
|
|
|
|
|
|
```jsx |
|
|
@ -40,7 +46,7 @@ CSS classes are generally more efficient than inline styles. |
|
|
|
|
|
|
|
### What is CSS-in-JS? |
|
|
|
|
|
|
|
CSS-in-JS refers to a pattern where CSS is written with Javascript, then extracted into a stylesheet. |
|
|
|
CSS-in-JS refers to a pattern where CSS is written with Javascript, then extracted into a stylesheet.It is `not mandatory` to use CSS-in-JS. |
|
|
|
|
|
|
|
[Comparison of CSS-in-JS Libraries](https://github.com/MicheleBertoli/css-in-js) |
|
|
|
|
|
|
|