All Projects → astrada → bs-css-core

astrada / bs-css-core

Licence: ISC license
BuckleScript statically typed DSL for CSS (forked from https://github.com/SentiaAnalytics/bs-css)

Programming Languages

reason
219 projects

Projects that are alternatives of or similar to bs-css-core

ogaml
Ocaml multimedia library
Stars: ✭ 28 (+86.67%)
Mutual labels:  reasonml
gobi
Compile OCaml/Reason to static iOS libraries
Stars: ✭ 25 (+66.67%)
Mutual labels:  reasonml
reactor
🚀 Native Actors for Reason and OCaml
Stars: ✭ 70 (+366.67%)
Mutual labels:  reasonml
reasonml-tic-tac-toe
www.imandra.ai
Stars: ✭ 19 (+26.67%)
Mutual labels:  reasonml
reason-vue
ReasonML and Vue
Stars: ✭ 55 (+266.67%)
Mutual labels:  reasonml
genTypeScript
Auto generation of type-safe bindings between Reason and Typescript.
Stars: ✭ 75 (+400%)
Mutual labels:  reasonml
rx-reason
Reactive programming library for ReasonML/OCaml
Stars: ✭ 49 (+226.67%)
Mutual labels:  reasonml
agda-mode-vscode
agda-mode on VS Code
Stars: ✭ 112 (+646.67%)
Mutual labels:  reasonml
bs-immutablejs
Reason + BuckleScript bindings to Immutable.js
Stars: ✭ 28 (+86.67%)
Mutual labels:  reasonml
hello-ppx-esy
A simple example of a ppx with Reason and esy
Stars: ✭ 38 (+153.33%)
Mutual labels:  reasonml
LifeTime
LifeTime app
Stars: ✭ 35 (+133.33%)
Mutual labels:  reasonml
reform
📋 Reasonably making forms sound good
Stars: ✭ 345 (+2200%)
Mutual labels:  reasonml
reasonml-minimal-config
ReasonML minimal webpack config with webpack-dashboard & reports enabled
Stars: ✭ 16 (+6.67%)
Mutual labels:  reasonml
sonos-wejay
Slack integration for a local Sonos system
Stars: ✭ 19 (+26.67%)
Mutual labels:  reasonml
bs-Zarith
Support Bigint, Q (rational numbers) and Z (integer numbers) in BuckleScript.
Stars: ✭ 15 (+0%)
Mutual labels:  reasonml
ideas-for-project-names-starting-with-re
No description or website provided.
Stars: ✭ 27 (+80%)
Mutual labels:  reasonml
ppx rapper
Syntax extension for writing SQL in OCaml
Stars: ✭ 91 (+506.67%)
Mutual labels:  reasonml
rescript-jest
ReScript bindings for Jest
Stars: ✭ 274 (+1726.67%)
Mutual labels:  reasonml
reason-catstagram
🐈 Catstagram made with ReasonReact!
Stars: ✭ 31 (+106.67%)
Mutual labels:  reasonml
Reason-react-hooks
🧶 Some hooks in ReasonML for reason-react that can be useful
Stars: ✭ 14 (-6.67%)
Mutual labels:  reasonml

bs-css-core

Statically typed DSL for writing CSS in ReasonML.

This is a fork of bs-css that extracts the Css module, so that it can be used by various CSS-in-JS bindings. See bs-react-fela-examples and bs-styletron-react-examples for practical examples of usage.

Installation

yarn add @astrada/bs-css-core

In your bsconfig.json, include "@astrada/bs-css-core" in the bs-dependencies.

Usage

open BsCssCore;

type theme = {
  textColor: Css.color,
  basePadding: Css.length
};

let makeStyle = (theme) =>
  Css.(
    style([
      backgroundColor(white),
      boxShadows([boxShadow(~y=px(3), ~blur=px(5), rgba(0, 0, 0, 0.3))]),
      padding(theme.basePadding),
      fontSize(rem(1.5)),
      color(theme.textColor),
      marginBottom(px(10))
    ])
  );

Keyframes

Define animation keyframes;

open BsCssCore;

let bounce =
  Css.(
    keyframes([
      (0, [transform(scale(0.1, 0.1)), opacity(0.0)]),
      (60, [transform(scale(1.2, 1.2)), opacity(1.0)]),
      (100, [transform(scale(1.0, 1.0)), opacity(1.0)])
    ])
  );

let makeStyle = (_theme) =>
  Css.(
    style([
      animationName(bounce),
      animationDuration(2000),
      width(px(50)),
      height(px(50)),
      backgroundColor(rgb(255, 0, 0))
    ])
  );

Development

yarn start

Where is the documentation?

Documentation generated with redoc is published here.

Thanks

Thanks to bs-css that introduced the DSL. Thanks to bs-glamor which bs-css was forked from. Thanks to elm-css for DSL design inspiration. Thanks to @jaredly for redoc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].