All Projects → tabazevedo → styletron-connect

tabazevedo / styletron-connect

Licence: MIT License
A high-level interface to styletron, similar to react-redux's connect

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to styletron-connect

Styletron
⚡ Toolkit for component-oriented styling
Stars: ✭ 3,217 (+18823.53%)
Mutual labels:  css-in-js, styletron
bredon
A modern CSS value compiler in JavaScript
Stars: ✭ 39 (+129.41%)
Mutual labels:  css-in-js
Styled-Responsive-Media-Queries
Responsive Media Queries for Emotion styled or styled-components — Standard size from Chrome DevTools.
Stars: ✭ 33 (+94.12%)
Mutual labels:  css-in-js
benefit
✨ Utility CSS-in-JS library that provides a set of low-level, configurable, ready-to-use styles
Stars: ✭ 51 (+200%)
Mutual labels:  css-in-js
system-ui.com
Standards for creating consistent, interoperable user interfaces
Stars: ✭ 64 (+276.47%)
Mutual labels:  css-in-js
boss-lite
Boss Lite - React Redux Material Admin Template
Stars: ✭ 148 (+770.59%)
Mutual labels:  css-in-js
linaria-styled
Zero-runtime CSS in JS library for building React components
Stars: ✭ 17 (+0%)
Mutual labels:  css-in-js
stitchwind
A bridge between Tailwind and Stitches
Stars: ✭ 33 (+94.12%)
Mutual labels:  css-in-js
mugiwara
fast minimal CSS-in-JS created to reduce size of CSS injected
Stars: ✭ 11 (-35.29%)
Mutual labels:  css-in-js
visage
Visage design system
Stars: ✭ 12 (-29.41%)
Mutual labels:  css-in-js
css-render
Generating CSS using JS with considerable flexibility and extensibility, at both server side and client side.
Stars: ✭ 137 (+705.88%)
Mutual labels:  css-in-js
siimple
The minimal and themeable CSS toolkit for flat and clean designs
Stars: ✭ 525 (+2988.24%)
Mutual labels:  css-in-js
glitz
Lightweight CSS-in-JS library with high performance written in TypeScript
Stars: ✭ 42 (+147.06%)
Mutual labels:  css-in-js
Aris
Aris - A fast and powerful tool to write HTML in JS easily. Includes syntax highlighting, templates, SVG, CSS autofixing, debugger support and more...
Stars: ✭ 61 (+258.82%)
Mutual labels:  css-in-js
csstips
CSS Tips to help beginners using CSS in TS / JS
Stars: ✭ 50 (+194.12%)
Mutual labels:  css-in-js
stitches-site
stitches.dev
Stars: ✭ 240 (+1311.76%)
Mutual labels:  css-in-js
mediocre-pictures
Helping you take mediocre pictures, hands-free. 📷🙆🏻🙅🏾💁🏼📸
Stars: ✭ 16 (-5.88%)
Mutual labels:  css-in-js
elegant-react-ssr
Server-side rendering with create-react-app, React Router v4, Helmet, Redux, and Thunk boilerplate, without ejecting CRA
Stars: ✭ 16 (-5.88%)
Mutual labels:  css-in-js
styled-components-docs-zh
💅 styled-components 中文文档翻译 🏇持续施工中
Stars: ✭ 160 (+841.18%)
Mutual labels:  css-in-js
adonis
Adonis ❤️ Aphrodite
Stars: ✭ 44 (+158.82%)
Mutual labels:  css-in-js

styletron-connect

Build Status

npm install --save styletron-connect

What is it?

styletron-connect provides an alternative higher-level API to styletron-react. Instead of wrapping single components in a styled() call, you add a decorator around your entire component which will resolve a styles object and pass it through for you.

Usage

styletron-connect, like styletron-react, supports passing both a static object and a function that takes props, and returns an object.

Static styles
import connectStyles from 'styletron-connect';

const Panel = ({ styles, children }) => (
  <div className={styles.panel}>
    {children}
  </div>
);

export default connectStyles(Panel, {
  panel: {
    backgroundColor: 'lightblue',
    fontSize: '12px'
  }
});

<Panel>Hello World</Panel>
Using props in styles
import connectStyles from 'styletron-connect';

const Panel = ({ styles, children }) => (
  <div className={styles.panel}>
    {children}
  </div>
);

export default connectStyles(Panel, (props) => ({
  panel: {
    backgroundColor: props.alert ? 'orange' : 'lightblue',
    fontSize: '12px'
  }
}));

<Panel alert>Danger!</Panel>
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].