Skip to main content

Styles

We recommend creating a folder for your styles, but this is optional. You can have style files anywhere.

Terminal.app
mkdir styles

CSS

To use a style file you must import it inside your JS files where it is needed.

templates/main.js
import "../styles/style.css";

SCSS/SASS

If you need SCSS/SASS you must install an extra dependency:

Terminal.app
yarn add --dev sass

Now you can import the those files as usual

templates/main.js
import "../styles/style.scss";
import "../styles/style.sass";

LESS

No need for extra dependencies. Just import those files.

templates/main.js
import "../styles/style.less";

Stylus

No need for extra dependencies. Just import those files.

templates/main.js
import "../styles/style.styl";

Tailwind CSS

For Tailwind support refer to our starter template: react-typescript-tailwind.