Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abstractpoint/styled-blocks

Styled Component Primitives for rapid prototyping in React!
https://github.com/abstractpoint/styled-blocks

css-in-js react styled-components

Last synced: 1 day ago
JSON representation

Styled Component Primitives for rapid prototyping in React!

Awesome Lists containing this project

README

        

# STYLED <♒️ _> BLOCKS
*Styled Component Primitives for rapid prototyping in React!*

---

Styled Blocks is a bunch of primitives you can simply import,
add some style props to, easily use your theme, ship! 🚢

No need to learn *yet another API*, you already know it. 🕶

`npm i styled-blocks` OR `yarn add styled-blocks`

```
import {
Col,
Grid,
Block,
Inline,
InlineBlock,
InlineCol,
InlineRow,
Row
} from 'styled-blocks';

```
```
// theme.js
export default {
breakpoints: ['30rem', '60rem'],
...
c: {
primary: {
500: '#eebbdd',
600: '#11ee33',
700: '#33ff00',
}
},
shadow: [
'5px 10px #888888',
'7px 15px #999999',
]
}
```

## Breakpoints / Media Queries 🥞
In your theme, define breakpoints as a property and array
as value.
```
{
breakpoints: ['30rem', '60rem'],
...
}
```

then in your components you can supply an array to any
styled prop, for example:

` theme.c.primary['500']}; // theme also works here as expected
}
`;
...

```

## Inspired by 💖
This project was inspired by excellent other efforts:
* [Subatomic](https://github.com/gragland/subatomic)
* [jsxstyle](https://github.com/jsxstyle/jsxstyle)
* [Tachyons](https://tachyons.io/)
* [Tailwind](https://tailwindcss.com)