# @divykj/react-style-codes

> > Easier react styling using codes.

Latest version **1.0.0** (published 2020-05-07) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @divykj/react-style-codes
pnpm add @divykj/react-style-codes
yarn add @divykj/react-style-codes
bun add @divykj/react-style-codes
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-05-07 |
| First published | 2020-05-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Divya Jain |
| Maintainers | divykj |
| Keywords | react, style |

## Links

- npm: https://www.npmjs.com/package/@divykj/react-style-codes
- Repository: https://github.com/divykj/react-style-codes
- Homepage: https://github.com/divykj/react-style-codes#readme
- Issues: https://github.com/divykj/react-style-codes/issues
- npm.io page: https://npm.io/package/@divykj/react-style-codes

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-05-07

## README

# react-style-codes

> Easier react styling using codes.

## Installation

```sh
npm i react-style-codes
```

## Usage

React Native:

```javascript
import React from 'react';
import { View, Text } from 'react-native';
import { makeStyles } from 'react-style-codes';

const containerStyle = makeStyles(['m-s', 'p-b-6', 'f-g-1']); // {margin: 4(small), paddingBottom: 6, flexGrow: 1}

const App = (props) => (
    <View style={containerStyle}>
        <Text>Hi</Text>
    </View>
);
```

## Documentation

### Functions:

-   **makeStyle(code)**:
    Takes a code and generates styles.

-   **makeStyles(codes)**:
    Takes an array of codes and generates styles.

### Codes:

-   **Padding**

    `'p-<location?>-<size>'`

    -   **location(optional):** 'a'(default) | 't' | 'r' | 'b' | 'l' | 'h' | 'v'
    -   **size:** 'n' | 'xs' | 's' | 'm'(default) | 'l' | 'xl' | number

-   **Margin**

    `'m-<location?>-<size>'`

    -   **location(optional):** 'a'(default) | 't' | 'r' | 'b' | 'l' | 'h' | 'v'
    -   **size:** 'n' | 'xs' | 's' | 'm'(default) | 'l' | 'xl' | number

-   **Flex**

    `'f-<number?>'`: flex value

    `'f-g-<number?>'`: flexGrow value

    `'f-s-<number?>'`: flexShrink value

    `'f-d-<direction?>'`: flexDirection value

    -   **direction(optional):** 'c'(default) | 'r'

-   **Grid**

    Container: `'g'`

    Row: `'g-row-<position?>-<gap?>'`

    Col: `'g-col-<position?>-<gap?>'`

    -   **position(optional):** 'first' | 'center'(default) | 'last' | 'only'
    -   **gap(optional):** 'n' | 'xs' | 's' | 'm'(default) | 'l' | 'xl' | number

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