Skip to content

ribeirotomas1904/typed-css-classes

Repository files navigation

Installation

npm install --save typed-css-classes

Then add the ppx in your bsconfig.json file:

"ppx-flags": [
  "typed-css-classes/ppx"
]

Usage

CSS Modules

%%css.module(let css = "./styles.module.css")

@react.component
let make = () => {
  <h1 className={css["title"]}> {"Hello World!"->React.string} </h1>
}

Importing global CSS

%%css.import(let css = "./styles.css")

@react.component
let make = () => {
  <h1 className={css["title"]}> {"Hello World!"->React.string} </h1>
}