tailwind-styled-components
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -1,2 +0,2 @@ | ||
declare const _default: string[]; | ||
export default _default; | ||
declare const elementsArray: (keyof JSX.IntrinsicElements)[]; | ||
export default elementsArray; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = [ | ||
const elementsArray = [ | ||
"a", | ||
@@ -68,3 +68,2 @@ "abbr", | ||
"mark", | ||
"marquee", | ||
"menu", | ||
@@ -141,2 +140,3 @@ "menuitem", | ||
]; | ||
exports.default = elementsArray; | ||
//# sourceMappingURL=domElements.js.map |
@@ -1,9 +0,9 @@ | ||
declare type FunctionTemplate = (template: TemplateStringsArray, ...templateElements: any[]) => (props: { | ||
export declare type FunctionTemplate = (template: TemplateStringsArray, ...templateElements: any[]) => (props: { | ||
children?: any; | ||
[props: string]: any; | ||
}) => any; | ||
declare type IntrinsicElements = { | ||
[key in keyof JSX.IntrinsicElements]?: FunctionTemplate; | ||
export declare type IntrinsicElements = { | ||
[key in keyof JSX.IntrinsicElements]: FunctionTemplate; | ||
}; | ||
declare const tw: ((Component: any) => FunctionTemplate) & IntrinsicElements; | ||
export default tw; |
@@ -35,5 +35,8 @@ "use strict"; | ||
const functionTemplate = (Element) => (template, ...templateElements) => react_1.default.forwardRef(({ children, ...props }, ref) => (react_1.default.createElement(Element, Object.assign({}, props, { ref: ref, className: parseTailwindClassNames(cleanTemplate(template, props.className), ...templateElements.map((t) => t(props))) }), children))); | ||
const intrinsicElements = domElements_1.default.reduce((acc, domElement) => ({ ...acc, [domElement]: functionTemplate(domElement) }), {}); | ||
const intrinsicElements = domElements_1.default.reduce((acc, domElement) => ({ | ||
...acc, | ||
[domElement]: functionTemplate(domElement) | ||
}), {}); | ||
const tw = Object.assign((Component) => functionTemplate(Component), intrinsicElements); | ||
exports.default = tw; | ||
//# sourceMappingURL=tailwind.js.map |
{ | ||
"name": "tailwind-styled-components", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"keywords": [ | ||
@@ -22,3 +22,3 @@ "react", | ||
"build": "tsc", | ||
"watch": "tsc -w", | ||
"dev": "tsc -w", | ||
"clean": "rimraf dist", | ||
@@ -25,0 +25,0 @@ "prepublishOnly": "npm run clean && npm run build" |
# Tailwind-Styled-Component | ||
Create tailwind css react components like styled components with classes name on multiple lines | ||
[![NPM version][npm-image]][npm-url] | ||
[npm-image]: http://img.shields.io/npm/v/tailwind-styled-components.svg?style=flat-square | ||
[npm-url]: http://npmjs.org/package/tailwind-styled-components | ||
## Install | ||
@@ -60,5 +66,5 @@ | ||
✅ Do `${p => p.primary ? "bg-indigo-600" : "bg-indigo-300"}` | ||
✅ Do `${p => p.primary ? "bg-indigo-600" : "bg-indigo-300"}` | ||
❌ Don't `bg-indigo-${p => p.primary ? "600" : "300"}` | ||
❌ Don't `bg-indigo-${p => p.primary ? "600" : "300"}` | ||
@@ -65,0 +71,0 @@ --- |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62087
201
182