Skip to content

Commit

Permalink
switch classnames to classname
Browse files Browse the repository at this point in the history
  • Loading branch information
franklintarter committed Oct 15, 2019
1 parent 97036a1 commit 9c81b0a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Paragraph = ({ children, ...rest }) => {
return <p {...rest}>{children}</p>;
};

Paragraph.defaultClassNames = "text-gray-800 font-sans mb-6";
Paragraph.defaultClassName = "text-gray-800 font-sans mb-6";

export default Paragraph;
```
Expand Down
4 changes: 2 additions & 2 deletions demo/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ const Paragraph = ({ children, ...rest }) => {
return <p {...rest}>{children}</p>;
};

Paragraph.defaultClassNames = "font-light text-lg tracking-wide mb-6 text-body";
Paragraph.defaultClassName = "font-light text-lg tracking-wide mb-6 text-body";

const Overload = withTailwindOverload(Paragraph);

const Demo = () => {
return (
<div>
<h1>tailwind-overload Demo</h1>
<h1>tailwindcss-overload Demo</h1>
<Overload className="text-gray-500 mb-2 text-md font-hairline">
Inspect me and check out my classes!
</Overload>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tailwindcss-overload",
"version": "0.0.1",
"version": "0.0.2",
"description": "tailwindcss-overload",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const overloadTailwind = (initialClasses, overloadClasses) => {
export const withTailwindOverload = PassedComponent => {
return ({ className, ...rest }) => {
const overloadedClasses = overloadTailwind(
PassedComponent.defaultClassNames,
PassedComponent.defaultClassName,
className
);
return <PassedComponent {...rest} className={overloadedClasses} />;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("withTailwindOverload", () => {
return <p {...rest}>{children}</p>;
};

TestComponent.defaultClassNames =
TestComponent.defaultClassName =
"font-light text-lg tracking-wide mb-6 text-body";

const Overloaded = withTailwindOverload(TestComponent);
Expand Down

0 comments on commit 9c81b0a

Please sign in to comment.