Skip to content

Commit

Permalink
chore: extract tailwind config (#499)
Browse files Browse the repository at this point in the history
* extract tailwind config package

* use shared config in extension

* use shared tailwind config in example app

* use shared tailwind config in app

* use shared tailwind config for landing page

* remove important modifier
  • Loading branch information
frontendphil authored Jan 9, 2025
1 parent 44b8827 commit 0fe7f0c
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 54 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"**/renovate.json",
"**/esbuild.js",
"**/tailwind.config.js",
"**/tailwind.config.mjs",
"**/tailwind.config.ts",
"**/vite.config.ts",
"**/entry.server.tsx",
Expand Down
19 changes: 19 additions & 0 deletions configs/tailwind/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@zodiac/tailwind-config",
"private": true,
"type": "module",
"license": "UNLICENSED",
"sideEffects": false,
"packageManager": "[email protected]",
"main": "./tailwind.config.mjs",
"exports": {
".": {
"import": "./tailwind.config.mjs",
"default": "./tailwind.config.mjs"
}
},
"dependencies": {},
"peerDependencies": {
"tailwindcss": "3.4.17"
}
}
16 changes: 16 additions & 0 deletions configs/tailwind/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
content: [
'./src/**/*.{tsx,html}',
'./app/**/*.tsx',
'./public/*.html',
'./node_modules/@zodiac/ui/**/*.tsx',
],
theme: {
extend: {
fontFamily: {
mono: '"Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
},
},
},
plugins: [],
}
1 change: 1 addition & 0 deletions deployables/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"@vitest/coverage-v8": "2.1.8",
"@zodiac/tailwind-config": "workspace:*",
"@zodiac/test-utils": "workspace:*",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
Expand Down
25 changes: 2 additions & 23 deletions deployables/app/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
import zodiacTailwindConfig from '@zodiac/tailwind-config'
import type { Config } from 'tailwindcss'

export default {
content: [
'./app/**/{**,.client,.server}/**/*.{js,jsx,ts,tsx}',
'../../packages/ui/**/*.tsx',
],
theme: {
extend: {
fontFamily: {
sans: [
'"Inter"',
'ui-sans-serif',
'system-ui',
'sans-serif',
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
'"Noto Color Emoji"',
],
},
},
},
plugins: [],
} satisfies Config
export default zodiacTailwindConfig satisfies Config
1 change: 1 addition & 0 deletions deployables/example-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@types/chrome": "^0.0.290",
"@types/react": "^19.0.0",
"@zodiac/eslint-config": "workspace:*",
"@zodiac/tailwind-config": "workspace:*",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"globals": "^15.8.0",
Expand Down
9 changes: 2 additions & 7 deletions deployables/example-app/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import zodiacTailwindConfig from '@zodiac/tailwind-config'
import type { Config } from 'tailwindcss'

export default {
content: ['./app/**/*.tsx'],
theme: {
extend: {},
},
plugins: [],
} satisfies Config
export default zodiacTailwindConfig satisfies Config
1 change: 1 addition & 0 deletions deployables/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@walletconnect/sign-client": "2.17.3",
"@walletconnect/universal-provider": "2.17.3",
"@zodiac/eslint-config": "workspace:*",
"@zodiac/tailwind-config": "workspace:*",
"@zodiac/test-utils": "workspace:*",
"autoprefixer": "^10.4.20",
"classnames": "^2.3.1",
Expand Down
17 changes: 3 additions & 14 deletions deployables/extension/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
import zodiacTailwindConfig from '@zodiac/tailwind-config'

/** @type {import('tailwindcss').Config} */
export default {
...zodiacTailwindConfig,
important: true,
content: [
'./src/**/*.tsx',
'./public/*.html',
'./src/**/*.html',
'../../packages/ui/**/*.tsx',
],
theme: {
extend: {
fontFamily: {
mono: '"Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
},
},
},
plugins: [],
}
1 change: 1 addition & 0 deletions deployables/landing-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"devDependencies": {
"@vitejs/plugin-react": "^4.3.4",
"@zodiac/eslint-config": "workspace:*",
"@zodiac/tailwind-config": "workspace:*",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"postcss": "^8.4.47",
Expand Down
13 changes: 3 additions & 10 deletions deployables/landing-page/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import zodiacTailwindConfig from '@zodiac/tailwind-config'
import type { Config } from 'tailwindcss'

const tailwindConfig = {
important: true,
content: ['./src/**/*.tsx', './index.html', '../../packages/ui/**/*.tsx'],
theme: {
extend: {
fontFamily: {
mono: '"Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
},
},
},
plugins: [],
...zodiacTailwindConfig,
content: [...zodiacTailwindConfig.content, './index.html'],
} satisfies Config

export default tailwindConfig
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0fe7f0c

Please sign in to comment.