From 61c048fb4f6aee32c781bae1ee8f9f46282f55f0 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 15 May 2019 14:33:03 +0200 Subject: [PATCH] Add 'tailwind' as extra option for root StyleSheet object --- README.md | 2 +- color.js | 34 ---------------------------------- index.d.ts | 3 ++- index.js | 2 ++ package.json | 2 +- 5 files changed, 6 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 52f025c..73592c5 100644 --- a/README.md +++ b/README.md @@ -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 tailwindCSS-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'; diff --git a/color.js b/color.js index 79346dc..ee4c558 100644 --- a/color.js +++ b/color.js @@ -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 = {}; diff --git a/index.d.ts b/index.d.ts index 9dfd106..5f46d97 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1258,4 +1258,5 @@ interface TailwindColors { export const t: TailwindStyles; export const tw: TailwindStyles; -export const color: TailwindColors; \ No newline at end of file +export const tailwind: TailwindStyles; +export const color: TailwindColors; diff --git a/index.js b/index.js index b865d92..7da6949 100644 --- a/index.js +++ b/index.js @@ -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, }; diff --git a/package.json b/package.json index 5f37d55..db4db26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-tailwindcss", - "version": "1.0.1", + "version": "1.0.2", "keywords": [ "react", "native",