Skip to content

Commit 8a4edd5

Browse files
committed
Enable Tailwind CSS
1 parent 13d4f7c commit 8a4edd5

File tree

17 files changed

+481
-159
lines changed

17 files changed

+481
-159
lines changed

.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:

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
v20

.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"

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import configReactJSXRuntime from 'eslint-plugin-react/configs/jsx-runtime.js';
1313
import pluginReactHooks from 'eslint-plugin-react-hooks';
1414
import {fixupPluginRules} from '@eslint/compat';
1515
import configPrettierRecommended from 'eslint-plugin-prettier/recommended';
16+
import tailwindPlugin from 'eslint-plugin-tailwindcss';
1617

1718
export default [
1819
eslint.configs.recommended,
1920
...eslintTS.configs.recommended,
2021
...eslintTS.configs.stylistic,
22+
...tailwindPlugin.configs['flat/recommended'],
2123
configReactRecommended,
2224
configReactJSXRuntime,
2325
configPrettierRecommended,

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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"eslint-plugin-react-refresh": "0.4.14",
9292
"eslint-plugin-ssr-friendly": "1.3.0",
9393
"eslint-plugin-storybook": "0.11.0",
94+
"eslint-plugin-tailwindcss": "3.17.5",
9495
"generate-react-cli": "8.4.9",
9596
"husky": "9.1.6",
9697
"identity-obj-proxy": "3.0.0",
@@ -110,6 +111,7 @@
110111
"stylelint-config-standard": "36.0.1",
111112
"stylelint-order": "6.0.4",
112113
"stylelint-prettier": "5.0.2",
114+
"tailwindcss": "3.4.14",
113115
"ts-jest": "29.2.5",
114116
"ts-node": "10.9.2",
115117
"typescript": "5.6.3",

pnpm-lock.yaml

Lines changed: 426 additions & 75 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 = {
@@ -21,9 +20,12 @@ export const Counter: FC<Props> = ({initialValue = 0}) => {
2120
}, []);
2221

2322
return (
24-
<div className={classes.counter}>
25-
<h2 className={classes.header}>Counter</h2>
26-
<button className={classes.button} type="button" onClick={incrementCount}>
23+
<div className="w-60 border border-slate-300 p-6 text-center">
24+
<h2 className="mb-3 text-2xl">Counter</h2>
25+
<button
26+
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"
27+
type="button"
28+
onClick={incrementCount}>
2729
Increment by one
2830
</button>
2931
<div>

0 commit comments

Comments
 (0)