# @quarkly/elementary

> Library for creating atomic react components

Latest version **1.1.4** (published 2019-08-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @quarkly/elementary
pnpm add @quarkly/elementary
yarn add @quarkly/elementary
bun add @quarkly/elementary
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2019-08-12 |
| First published | 2019-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 55.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Eddort |
| Maintainers | eddort |
| Keywords | react, styled-components, css-in-js, atomic-css, atomic-components, styled-system |

## Links

- npm: https://www.npmjs.com/package/@quarkly/elementary
- Repository: https://github.com/quarkly/elementary
- Homepage: https://github.com/quarkly/elementary#readme
- Issues: https://github.com/quarkly/elementary/issues
- npm.io page: https://npm.io/package/@quarkly/elementary

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) >=4.17.13
- [lodash.merge](https://npm.io/package/lodash.merge.md) >=4.6.2

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2019-08-12
- 1.1.3 — 2019-08-12
- 1.1.2 — 2019-07-04
- 1.1.1 — 2019-07-01
- 1.1.0 — 2019-07-01
- 1.0.8 — 2019-06-29
- 1.0.7 — 2019-06-29
- 1.0.6 — 2019-06-28
- 1.0.5 — 2019-06-24
- 1.0.4 — 2019-06-14
- 1.0.3 — 2019-06-13
- 1.0.2 — 2019-06-13
- 1.0.1 — 2019-06-10
- 1.0.0 — 2019-06-09
- 1.0.0-alpha-1 — 2019-06-09
- … 15 more at https://npm.io/package/@quarkly/elementary/versions

## README

<p>
  <img src="https://github.com/quarkly/elementary/raw/master/docs/src/q-elementary.png" width="200px">
</p>
<h1> Elementary </h1>
<p>
  <b>Elementary is a library for creating atomic react components. 
Inspired by <a href="http://tachyons.io/" target="_blank">tachyons</a> and <a href="https://github.com/styled-system/styled-system" target="_blank">styled-system</a>.</b>
</p>
<br>

[![Build Status][badge]][travis]
[![Coverage][coverage-badge]][coverage]
[![Version][version-badge]][npm]
![MIT License][license]

<!-- ![size][] -->

[badge]: https://flat.badgen.net/travis/quarkly/elementary/master
[travis]: https://travis-ci.com/quarkly/elementary
[coverage-badge]: https://flat.badgen.net/codecov/c/github/quarkly/elementary
[coverage]: https://codecov.io/github/quarkly/elementary
[version-badge]: https://flat.badgen.net/npm/v/@quarkly/elementary
[npm]: https://npmjs.com/package/@quarkly/elementary
[license]: https://flat.badgen.net/badge/license/MIT/blue

<!-- [size]: https://flat.badgen.net/packagephobia/min/@quarkly/elementary -->

# Features

- Any css properties - props
- Simple writing media queries
- Alias ​​system
- Scaling indents and font sizes
- Support hover, focus ..etc as props
- Fully themed
- Mixins support

# Demo

 - [Codesandbox](https://codesandbox.io/embed/quarklyelementary-demo-jplhn)
 - [@quarkly/elements](https://github.com/quarkly/elements)

# Installation and Usage

```sh
npm i @quarkly/elementary
```

```sh
npm i styled-components
```

Let's create element:

```jsx
import React from 'react';
import ReactDom from 'react-dom';
import elementary from '@quarkly/elementary';

const Box = elementary.div();

ReactDom.render(
  <Box width={[1, 1 / 2, 1 / 4]} bgc={['red', 'green', 'blue']} height="300px" />,
  document.getElementById('root'),
);
```

Since Elementary is based on styled-components, the interface may be familiar to you. <br>

```jsx
const Box = elementary.div`
  border: 2px solid tomato;
`;
```

# Advanced usage

```jsx
import React from 'react';
import ReactDom from 'react-dom';
import elementary from '@quarkly/elementary';

const Box = elementary.div({
  effects: {
    hover: ':hover',
  },
  variant: 'boxes',
  rules: ['height', 'backgroundColor'],
});

ReactDom.render(
  <Box width={[1, 1 / 2, 1 / 4]} bgc={['red', 'green', 'blue']} height="300px" />,
  document.getElementById('root'),
);
```

First argument is the configuration:

- rules - an array of css properties that we will use.
- effects - what effects can be used from jsx (hover, focus ..etc)
- variant - options for component styles from themes
- name - componentName and default styles for this component from a theme

# Docs

- [Aliases](docs/aliases.md)
- [Theming](docs/theming.md)

# License

Licensed under MIT.

---
_Source: https://npm.io/package/@quarkly/elementary · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
