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

https://github.com/jossmac/adjustable

Adjustable helper utilities for CSS-in-JS
https://github.com/jossmac/adjustable

Last synced: 12 months ago
JSON representation

Adjustable helper utilities for CSS-in-JS

Awesome Lists containing this project

README

          

# adjustable

> NOTE: This is not ready for production.

Adjustable is a helper to support Tailwind-style utilities for CSS-in-JS.

### Install

```sh
yarn add adjustable
```

### Use

```jsx
import { Adjustable, Adjustment } from "./adjust";
import config from "./config";

const Heading = props => ;
const H1 = props => ;
const H2 = props => ;

function App() {
return (

Teal colored text



Centered text with padding top and bottom



);
}
```

### Config

```js
const colors = {
...
teal: "#4dc0b5",
};

const spacing = ["0", "0.5rem", "1rem", "1.5rem", "2rem"];

export default {
...
backgroundColors: colors,
borderRadius: [0, "0.125rem", "0.25rem", "0.5rem", "50%"],
fontWeight: [300, 400, 700],
leading: [1, 1.25, 1.5, 2],
margin: spacing,
padding: spacing,
textColors: colors,
tracking: ["-0.05em", "0", "0.05em"],
zIndex: [0, 100, 200, 300, 400, 500]
};
```