Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas committed May 6, 2019
1 parent 33f1841 commit 50266ce
Show file tree
Hide file tree
Showing 76 changed files with 6,657 additions and 6,643 deletions.
17 changes: 11 additions & 6 deletions README.md
@@ -1,11 +1,10 @@
# react-native-tailwindcss
# react-native-tailwindcss ![npm](https://img.shields.io/npm/dt/react-native-tailwindcss.svg)
## A react native styling system, based on [TailwindCSS](https://tailwindcss.com/docs/what-is-tailwind/)

Easily apply styles to react native components in a <a href='https://tailwindcss.com/docs/what-is-tailwind/'>tailwindCSS</a>-like fashion.
The utility classes are transformed to object valid names and are all children from an object `t` or `tw`.

```js
import {t} from 'react-native-tailwindcss'
```jsx harmony
import {t} from 'react-native-tailwindcss';

<View style={[t.absolute, t.inset0, t.p4, t.bgBlue500]} />
```
Expand All @@ -15,8 +14,8 @@ Use the `tailwind.config.js` file as you know and love to customize or just use
In react native sometimes you only need a color value, we've got you covered.
The `color` object contains all your defined colors.

```js
import {color} from 'react-native-tailwindcss'
```jsx harmony
import {color} from 'react-native-tailwindcss';

<StatusBar backgroundColor={color.blue500} />
```
Expand Down Expand Up @@ -91,3 +90,9 @@ Instead of using 'left' or 'right', 'start' and 'end' can be used.

`react-native-tailwindcss` offers classes to embrace this way of directional layout.
every 'class' with `L` or `R`, has also an `S` and `E` 'class' for start and end.

## Testing

```
npm run test
```
21 changes: 15 additions & 6 deletions __tests__/adjustable.test.js
@@ -1,20 +1,20 @@
import color from '../color'
import generator from "../util/generator";
import theme from "./fixtures/testConfigHandler"
import color from '../color';
import generator from '../util/generator';
import theme from './fixtures/testConfigHandler';

test('custom_colors', () => {
test('custom colors', () => {
const result = generator.generate('text', 'color', generator.generateColors(theme.colors));

expect(result).toEqual(require('./fixtures/outputs/adjustible/custom-color-output'));
});

test('custom_fonts', () => {
test('custom fonts', () => {
const result = generator.generate('font', 'fontFamily', theme.fontFamily);

expect(result).toEqual(require('./fixtures/outputs/adjustible/custom-font-output'));
});

test('custom_margin', () => {
test('custom margin', () => {
const result = generator.generate('m', 'margin', theme.margin, [
['x', 'marginHorizontal'],
['y', 'marginVertical'],
Expand All @@ -26,3 +26,12 @@ test('custom_margin', () => {

expect(result).toEqual(require('./fixtures/outputs/adjustible/custom-margin-output'));
});

test('plugin support', () => {
let result;

for (var i = 0; i < plugins.length; ++i) {
result = plugins[i]();
}
expect(result).toEqual({});
});
4 changes: 2 additions & 2 deletions __tests__/color.test.js
@@ -1,5 +1,5 @@
import color from '../color'
import color from '../color';

test('default_colors', () => {
test('default colors', () => {
expect(color).toEqual(require('./fixtures/outputs/color/color-output'));
});
206 changes: 103 additions & 103 deletions __tests__/fixtures/outputs/adjustible/custom-color-output.js
@@ -1,116 +1,116 @@
module.exports = {
textTransparent: {color: 'rgba(0,0,0,0)'},
textBlack: {color: '#000'},
textWhite: {color: '#fff'},
textGray100: {color: '#f7fafc'},
textGray200: {color: '#edf2f7'},
textGray300: {color: '#e2e8f0'},
textGray400: {color: '#cbd5e0'},
textGray500: {color: '#a0aec0'},
textGray600: {color: '#718096'},
textGray700: {color: '#4a5568'},
textGray800: {color: '#2d3748'},
textGray900: {color: '#1a202c'},
textTransparent: {color: 'rgba(0,0,0,0)'},
textBlack: {color: '#000'},
textWhite: {color: '#fff'},
textGray100: {color: '#f7fafc'},
textGray200: {color: '#edf2f7'},
textGray300: {color: '#e2e8f0'},
textGray400: {color: '#cbd5e0'},
textGray500: {color: '#a0aec0'},
textGray600: {color: '#718096'},
textGray700: {color: '#4a5568'},
textGray800: {color: '#2d3748'},
textGray900: {color: '#1a202c'},

textRed100: {color: '#fff5f5'},
textRed200: {color: '#fed7d7'},
textRed300: {color: '#feb2b2'},
textRed400: {color: '#fc8181'},
textRed500: {color: '#f56565'},
textRed600: {color: '#e53e3e'},
textRed700: {color: '#c53030'},
textRed800: {color: '#9b2c2c'},
textRed900: {color: '#742a2a'},
textRed100: {color: '#fff5f5'},
textRed200: {color: '#fed7d7'},
textRed300: {color: '#feb2b2'},
textRed400: {color: '#fc8181'},
textRed500: {color: '#f56565'},
textRed600: {color: '#e53e3e'},
textRed700: {color: '#c53030'},
textRed800: {color: '#9b2c2c'},
textRed900: {color: '#742a2a'},

textOrange100: {color: '#fffaf0'},
textOrange200: {color: '#feebc8'},
textOrange300: {color: '#fbd38d'},
textOrange400: {color: '#f6ad55'},
textOrange500: {color: '#ed8936'},
textOrange600: {color: '#dd6b20'},
textOrange700: {color: '#c05621'},
textOrange800: {color: '#9c4221'},
textOrange900: {color: '#7b341e'},
textOrange100: {color: '#fffaf0'},
textOrange200: {color: '#feebc8'},
textOrange300: {color: '#fbd38d'},
textOrange400: {color: '#f6ad55'},
textOrange500: {color: '#ed8936'},
textOrange600: {color: '#dd6b20'},
textOrange700: {color: '#c05621'},
textOrange800: {color: '#9c4221'},
textOrange900: {color: '#7b341e'},

textYellow100: {color: '#fffff0'},
textYellow200: {color: '#fefcbf'},
textYellow300: {color: '#faf089'},
textYellow400: {color: '#f6e05e'},
textYellow500: {color: '#ecc94b'},
textYellow600: {color: '#d69e2e'},
textYellow700: {color: '#b7791f'},
textYellow800: {color: '#975a16'},
textYellow900: {color: '#744210'},
textYellow100: {color: '#fffff0'},
textYellow200: {color: '#fefcbf'},
textYellow300: {color: '#faf089'},
textYellow400: {color: '#f6e05e'},
textYellow500: {color: '#ecc94b'},
textYellow600: {color: '#d69e2e'},
textYellow700: {color: '#b7791f'},
textYellow800: {color: '#975a16'},
textYellow900: {color: '#744210'},

textGreen100: {color: '#f0fff4'},
textGreen200: {color: '#c6f6d5'},
textGreen300: {color: '#9ae6b4'},
textGreen400: {color: '#68d391'},
textGreen500: {color: '#48bb78'},
textGreen600: {color: '#38a169'},
textGreen700: {color: '#2f855a'},
textGreen800: {color: '#276749'},
textGreen900: {color: '#22543d'},
textGreen100: {color: '#f0fff4'},
textGreen200: {color: '#c6f6d5'},
textGreen300: {color: '#9ae6b4'},
textGreen400: {color: '#68d391'},
textGreen500: {color: '#48bb78'},
textGreen600: {color: '#38a169'},
textGreen700: {color: '#2f855a'},
textGreen800: {color: '#276749'},
textGreen900: {color: '#22543d'},

textTeal100: {color: '#e6fffa'},
textTeal200: {color: '#b2f5ea'},
textTeal300: {color: '#81e6d9'},
textTeal400: {color: '#4fd1c5'},
textTeal500: {color: '#38b2ac'},
textTeal600: {color: '#319795'},
textTeal700: {color: '#2c7a7b'},
textTeal800: {color: '#285e61'},
textTeal900: {color: '#234e52'},
textTeal100: {color: '#e6fffa'},
textTeal200: {color: '#b2f5ea'},
textTeal300: {color: '#81e6d9'},
textTeal400: {color: '#4fd1c5'},
textTeal500: {color: '#38b2ac'},
textTeal600: {color: '#319795'},
textTeal700: {color: '#2c7a7b'},
textTeal800: {color: '#285e61'},
textTeal900: {color: '#234e52'},

textBlue100: {color: '#ebf8ff'},
textBlue200: {color: '#bee3f8'},
textBlue300: {color: '#90cdf4'},
textBlue400: {color: '#63b3ed'},
textBlue500: {color: '#4299e1'},
textBlue600: {color: '#3182ce'},
textBlue700: {color: '#2b6cb0'},
textBlue800: {color: '#2c5282'},
textBlue900: {color: '#2a4365'},
textBlue100: {color: '#ebf8ff'},
textBlue200: {color: '#bee3f8'},
textBlue300: {color: '#90cdf4'},
textBlue400: {color: '#63b3ed'},
textBlue500: {color: '#4299e1'},
textBlue600: {color: '#3182ce'},
textBlue700: {color: '#2b6cb0'},
textBlue800: {color: '#2c5282'},
textBlue900: {color: '#2a4365'},

textIndigo100: {color: '#ebf4ff'},
textIndigo200: {color: '#c3dafe'},
textIndigo300: {color: '#a3bffa'},
textIndigo400: {color: '#7f9cf5'},
textIndigo500: {color: '#667eea'},
textIndigo600: {color: '#5a67d8'},
textIndigo700: {color: '#4c51bf'},
textIndigo800: {color: '#434190'},
textIndigo900: {color: '#3c366b'},
textIndigo100: {color: '#ebf4ff'},
textIndigo200: {color: '#c3dafe'},
textIndigo300: {color: '#a3bffa'},
textIndigo400: {color: '#7f9cf5'},
textIndigo500: {color: '#667eea'},
textIndigo600: {color: '#5a67d8'},
textIndigo700: {color: '#4c51bf'},
textIndigo800: {color: '#434190'},
textIndigo900: {color: '#3c366b'},

textPurple100: {color: '#faf5ff'},
textPurple200: {color: '#e9d8fd'},
textPurple300: {color: '#d6bcfa'},
textPurple400: {color: '#b794f4'},
textPurple500: {color: '#9f7aea'},
textPurple600: {color: '#805ad5'},
textPurple700: {color: '#6b46c1'},
textPurple800: {color: '#553c9a'},
textPurple900: {color: '#44337a'},
textPurple100: {color: '#faf5ff'},
textPurple200: {color: '#e9d8fd'},
textPurple300: {color: '#d6bcfa'},
textPurple400: {color: '#b794f4'},
textPurple500: {color: '#9f7aea'},
textPurple600: {color: '#805ad5'},
textPurple700: {color: '#6b46c1'},
textPurple800: {color: '#553c9a'},
textPurple900: {color: '#44337a'},

textPink100: {color: '#fff5f7'},
textPink200: {color: '#fed7e2'},
textPink300: {color: '#fbb6ce'},
textPink400: {color: '#f687b3'},
textPink500: {color: '#ed64a6'},
textPink600: {color: '#d53f8c'},
textPink700: {color: '#b83280'},
textPink800: {color: '#97266d'},
textPink900: {color: '#702459'},
textPink100: {color: '#fff5f7'},
textPink200: {color: '#fed7e2'},
textPink300: {color: '#fbb6ce'},
textPink400: {color: '#f687b3'},
textPink500: {color: '#ed64a6'},
textPink600: {color: '#d53f8c'},
textPink700: {color: '#b83280'},
textPink800: {color: '#97266d'},
textPink900: {color: '#702459'},

textCyan: {color: '#9cdbff'},
textCyan: {color: '#9cdbff'},

textTransparentWhite100: {color: 'rgba(255, 255, 255, 0.1)'},
textTransparentWhite200: {color: 'rgba(255, 255, 255, 0.2)'},
textTransparentWhite300: {color: 'rgba(255, 255, 255, 0.3)'},
textTransparentWhite400: {color: 'rgba(255, 255, 255, 0.4)'},
textTransparentWhite500: {color: 'rgba(255, 255, 255, 0.5)'},
textTransparentWhite600: {color: 'rgba(255, 255, 255, 0.6)'},
textTransparentWhite700: {color: 'rgba(255, 255, 255, 0.7)'},
textTransparentWhite800: {color: 'rgba(255, 255, 255, 0.8)'},
textTransparentWhite900: {color: 'rgba(255, 255, 255, 0.9)'},
textTransparentWhite100: {color: 'rgba(255, 255, 255, 0.1)'},
textTransparentWhite200: {color: 'rgba(255, 255, 255, 0.2)'},
textTransparentWhite300: {color: 'rgba(255, 255, 255, 0.3)'},
textTransparentWhite400: {color: 'rgba(255, 255, 255, 0.4)'},
textTransparentWhite500: {color: 'rgba(255, 255, 255, 0.5)'},
textTransparentWhite600: {color: 'rgba(255, 255, 255, 0.6)'},
textTransparentWhite700: {color: 'rgba(255, 255, 255, 0.7)'},
textTransparentWhite800: {color: 'rgba(255, 255, 255, 0.8)'},
textTransparentWhite900: {color: 'rgba(255, 255, 255, 0.9)'},
};

0 comments on commit 50266ce

Please sign in to comment.