All Projects → styletron → Styletron

styletron / Styletron

Licence: mit
⚡ Toolkit for component-oriented styling

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Styletron

Css In Js
React: CSS in JS techniques comparison
Stars: ✭ 5,388 (+67.49%)
Mutual labels:  css-in-js, cssinjs
styled-media-helper
💅 Helps manage media queries with styled components
Stars: ✭ 76 (-97.64%)
Mutual labels:  css-in-js, cssinjs
Jss
JSS is an authoring tool for CSS which uses JavaScript as a host language.
Stars: ✭ 6,576 (+104.41%)
Mutual labels:  css-in-js, cssinjs
gloss
a powerful style system for building ui kits
Stars: ✭ 16 (-99.5%)
Mutual labels:  css-in-js, cssinjs
Fela
State-Driven Styling in JavaScript
Stars: ✭ 2,097 (-34.82%)
Mutual labels:  css-in-js, atomic-css
styletron-connect
A high-level interface to styletron, similar to react-redux's connect
Stars: ✭ 17 (-99.47%)
Mutual labels:  css-in-js, styletron
zaftig
~2kB css in js: z`display flex` // .zjsdkk43-1
Stars: ✭ 15 (-99.53%)
Mutual labels:  css-in-js
material-ui-theme-editor
Theme editor for material UI
Stars: ✭ 92 (-97.14%)
Mutual labels:  css-in-js
pigment
A powerful library that provides color-conversions, palette/scheme generation, color manipulation and many more features intended to provide a great UX.
Stars: ✭ 23 (-99.29%)
Mutual labels:  cssinjs
styled-jsx-plugin-sass
Plugin to add Sass support to styled-jsx.
Stars: ✭ 20 (-99.38%)
Mutual labels:  css-in-js
Shevyjs
Configurable Vertical Rhythm & Typography in CSS-in-JS
Stars: ✭ 292 (-90.92%)
Mutual labels:  css-in-js
Reactackle
Open-source components library built with React and Styled-Components.
Stars: ✭ 278 (-91.36%)
Mutual labels:  css-in-js
isotope
UI library that aims to bring simplicity and intuitiveness back to Web Development. 🚀
Stars: ✭ 52 (-98.38%)
Mutual labels:  css-in-js
atomize
A library of atomic CSS classes.
Stars: ✭ 51 (-98.41%)
Mutual labels:  atomic-css
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (-91.92%)
Mutual labels:  css-in-js
stylelint-processor-glamorous
💄 Lint glamorous and related css-in-js with stylelint
Stars: ✭ 18 (-99.44%)
Mutual labels:  css-in-js
Polychrome
🎨 Easy color manipulation in ~2kb (gzipped)
Stars: ✭ 286 (-91.11%)
Mutual labels:  css-in-js
satchel
The little bag of CSS-in-JS superpowers
Stars: ✭ 14 (-99.56%)
Mutual labels:  css-in-js
cease
Simple, isolated CSS-in-JS for React components
Stars: ✭ 21 (-99.35%)
Mutual labels:  css-in-js
Typestyle
Making CSS Typesafe 🌹
Stars: ✭ 2,944 (-8.49%)
Mutual labels:  css-in-js

Styletron logo

build status

Styletron is an universal toolkit for component-oriented styling. It falls into the CSS in JS category. Styletron works great with React but can be used with other frameworks or plain JS as well.

Go to our documentation at styletron.org!

Usage with React

import { styled } from "styletron-react";

// Create a styled component by passing an element name and a style object
const RedAnchor = styled("a", { color: "red" });
<RedAnchor href="/foo">Hello</RedAnchor>;

// Or pass a function that takes props and returns a style object
const Panel = styled("div", props => {
  return { backgroundColor: props.$alert ? "orange" : "lightblue" };
});
<Panel $alert>Hello</Panel>;

// Do you prefer hooks?
import { useStyletron } from "styletron-react";
const [css] = useStyletron();
<a className={css({ color: "red" })} href="/foo">
  Hello
</a>;

Getting Started

Check the documentation to setup Styletron with Next.js, Gatsby or plain React/JS apps.

Looking for v3.x docs? | v3.x to v4.x migration guide

Design principles

  1. Component-oriented
    • Stateless, single-element styled components as base styling primitive
    • Prop interfaces for conditional/dynamic styling
  2. Embrace typed JavaScript
    • Composition of styles via (typed) JavaScript objects
    • No extra tooling (e.g. Webpack loaders, Babel plugins, etc.)
  3. Portability and flexibility
    • Portability of styled components across different rendering engines (e.g. atomic CSS)

See docs/design.md for more details.

Packages

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].