Skip to content

Commit fc7eb66

Browse files
committed
Enable Tailwind CSS
1 parent addb9c6 commit fc7eb66

File tree

17 files changed

+481
-423
lines changed

17 files changed

+481
-423
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
'plugin:react/jsx-runtime',
2222
'plugin:react-hooks/recommended',
2323
'plugin:ssr-friendly/recommended',
24+
'plugin:tailwindcss/recommended',
2425
'plugin:storybook/recommended',
2526
'plugin:prettier/recommended',
2627
],

.github/workflows/pull-request-jobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Node.js CI
55

66
on:
77
pull_request:
8-
branches: [ master ]
8+
branches: ["master", "tailwind"]
99

1010
jobs:
1111
lint-test:

.stylelintrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@
1515
"at-rule-no-vendor-prefix": true,
1616
"selector-no-vendor-prefix": true,
1717
"max-nesting-depth": 3,
18-
"selector-max-compound-selectors": 5
18+
"selector-max-compound-selectors": 5,
19+
"at-rule-no-unknown": [
20+
true,
21+
{
22+
"ignoreAtRules": [
23+
"tailwind"
24+
]
25+
}
26+
]
1927
},
2028
"plugins": [
2129
"stylelint-order"

generate-react-cli.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"withHookTest": true,
1717
"customTemplates": {
1818
"component": "templates/Component/TemplateName.tsx",
19-
"style": "templates/Component/TemplateName.module.css",
2019
"story": "templates/Component/TemplateName.stories.tsx",
2120
"index": "templates/Component/index.ts",
2221
"mdx": "templates/Component/TemplateName.mdx",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"eslint-plugin-react-refresh": "0.4.6",
8888
"eslint-plugin-ssr-friendly": "1.3.0",
8989
"eslint-plugin-storybook": "0.8.0",
90-
"generate-react-cli": "8.4.1",
90+
"eslint-plugin-tailwindcss": "3.15.1",
9191
"husky": "9.0.11",
9292
"identity-obj-proxy": "3.0.0",
9393
"is-ci": "3.0.1",
@@ -105,6 +105,7 @@
105105
"stylelint-config-standard": "36.0.0",
106106
"stylelint-order": "6.0.4",
107107
"stylelint-prettier": "5.0.0",
108+
"tailwindcss": "3.4.3",
108109
"ts-jest": "29.1.2",
109110
"ts-node": "10.9.2",
110111
"typescript": "5.4.5",

pnpm-lock.yaml

Lines changed: 426 additions & 339 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
'postcss-preset-env': {},
5+
},
6+
};

src/lib/CounterDemo/Counter.module.css

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/lib/CounterDemo/Counter.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type {FC} from 'react';
22
import {useEffect} from 'react';
33
import {throttle} from 'lodash';
44

5-
import classes from './Counter.module.css';
65
import useLogic from './useLogic';
76

87
export type Props = {
@@ -20,9 +19,12 @@ export const Counter: FC<Props> = ({initialValue = 0}) => {
2019
runner();
2120
}, []);
2221
return (
23-
<div className={classes.counter}>
24-
<h2 className={classes.header}>Counter</h2>
25-
<button className={classes.button} type="button" onClick={incrementCount}>
22+
<div className="w-60 border border-slate-300 p-6 text-center">
23+
<h2 className="mb-3 text-2xl">Counter</h2>
24+
<button
25+
className="mb-6 rounded-lg bg-teal-600 px-6 py-3 text-base text-white drop-shadow-md active:relative active:left-0.5 active:top-0.5 active:drop-shadow-none"
26+
type="button"
27+
onClick={incrementCount}>
2628
Increment by one
2729
</button>
2830
<div>

src/lib/CounterDemo/__snapshots__/Counter.spec.tsx.snap

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
exports[`lib > Counter renders without crashing 1`] = `
44
<DocumentFragment>
5-
<div>
6-
<h2>
5+
<div
6+
class="w-60 border border-slate-300 p-6 text-center"
7+
>
8+
<h2
9+
class="mb-3 text-2xl"
10+
>
711
Counter
812
</h2>
913
<button
14+
class="mb-6 rounded-lg bg-teal-600 px-6 py-3 text-base text-white drop-shadow-md active:relative active:left-0.5 active:top-0.5 active:drop-shadow-none"
1015
type="button"
1116
>
1217
Increment by one

0 commit comments

Comments
 (0)