Skip to content

Commit

Permalink
Add 'tailwind' as extra option for root StyleSheet object
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas committed May 15, 2019
1 parent 5344b74 commit 61c048f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 37 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# react-native-tailwindcss [![npm](https://img.shields.io/npm/v/react-native-tailwindcss.svg)](https://github.com/TVke/react-native-tailwindcss/releases) [![npm](https://img.shields.io/npm/dt/react-native-tailwindcss.svg)](https://www.npmjs.com/package/react-native-tailwindcss)
## 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`.
The utility classes are transformed to object valid names and are all children from an object `t`, `tw` or `tailwind`.

```jsx harmony
import {t} from 'react-native-tailwindcss';
Expand Down
34 changes: 0 additions & 34 deletions color.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,5 @@
import generator from './util/generator';
import theme from './util/configHandler';
//
// const colors = theme.colors;
//
// let colorList = {};
//
// for (let color in colors) {
// let currentColor, colorKey, colorValue, colorName, currentColorKeys;
//
// if (colors.hasOwnProperty(color)) {
// colorName = color
// }
//
// currentColor = colors[colorName];
//
// if (typeof currentColor !== 'object') {
// colorValue = generator.translateValues(currentColor);
//
// colorName = generator.translateKeys(colorName);
//
// colorList[colorName] = colorValue
// }
//
// if (typeof currentColor === 'object') {
// currentColorKeys = Object.getOwnPropertyNames(currentColor);
//
// currentColorKeys.map(key => {
// colorValue = generator.translateValues(currentColor[key]);
//
// colorKey = generator.translateKeys(`${colorName}-${key}`);
//
// colorList[colorKey] = colorValue
// })
// }
// }

let colors = {};

Expand Down
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1258,4 +1258,5 @@ interface TailwindColors {

export const t: TailwindStyles;
export const tw: TailwindStyles;
export const color: TailwindColors;
export const tailwind: TailwindStyles;
export const color: TailwindColors;
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import color from './color';
import tailwind from './tailwind';
import tw from './tailwind';
import t from './tailwind';

export {
t,
tw,
tailwind,
color,
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-tailwindcss",
"version": "1.0.1",
"version": "1.0.2",
"keywords": [
"react",
"native",
Expand Down

0 comments on commit 61c048f

Please sign in to comment.