Home

Awesome

diet-cola

A lightweight styled-components clone for creating React UI component primitives. Built with stylis and glamor.

npm i diet-cola
import dc from 'diet-cola'

const Button = dc('button')(`
  font-family: inherit;
  font-size: inherit;
  padding: 8px;
  margin: 0;
  color: white;
  background-color: tomato;
  border: 0;
  border-radius: 4px;
  appearance: none;
  &:hover {
    background-color: black;
  }
`)

Features

Motivation

Styled Components is an excellent API for creating UI component primitives in React, but in its current state, it has several features that might not be needed for most use cases. This library is also meant as a proof of concept of using existing libraries to create a small, custom css-in-js solution.

Differences

Compared to styled-components, diet-cola:

Related:

MIT License