Skip to content

Commit 28a2a77

Browse files
Added Tailwind shared config (#19)
* Added Tailwind shared config * Added shared style for elements * Package upgrade * Font family changed * Renamed tailwind.css and remove font family
1 parent 13103d7 commit 28a2a77

File tree

8 files changed

+52
-51
lines changed

8 files changed

+52
-51
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "submodules/react-components"]
55
path = submodules/react-components
66
url = https://github.com/code-kern-ai/submodule-react-components.git
7+
[submodule "submodules/tailwind-config"]
8+
path = submodules/tailwind-config
9+
url = https://github.com/code-kern-ai/submodule-tailwind-config.git

package.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@headlessui/react": "^1.7.18",
12+
"@headlessui/react": "^1.7.19",
13+
"@headlessui/tailwindcss": "^0.2.1",
1314
"@nextui-org/react": "^1.0.0-beta.13",
1415
"@ory/client": "^1.1.24",
1516
"@ory/integrations": "^1.1.0",
1617
"@ory/kratos-client": "^0.11.1",
1718
"@ory/themes": "^0.0.101",
18-
"@tabler/icons-react": "^3.2.0",
19-
"@tailwindcss/forms": "^0.5.3",
20-
"@types/node": "18.15.12",
21-
"@types/react": "18.0.37",
22-
"@types/react-dom": "18.0.11",
19+
"@tabler/icons-react": "^3.8.0",
20+
"@tailwindcss/forms": "^0.5.7",
21+
"@types/node": "18.19.39",
22+
"@types/react": "^18.3.3",
23+
"@types/react-dom": "^18.3.0",
2324
"cors": "^2.8.5",
2425
"eslint": "8.38.0",
2526
"eslint-config-next": "13.3.0",
@@ -37,8 +38,8 @@
3738
"@types/cors": "^2.8.13",
3839
"@types/express": "^4.17.17",
3940
"@types/styled-components": "^5.1.26",
40-
"autoprefixer": "^10.4.14",
41+
"autoprefixer": "^10.4.19",
4142
"postcss": "^8.4.23",
42-
"tailwindcss": "^3.3.1"
43+
"tailwindcss": "^3.4.4"
4344
}
44-
}
45+
}

pages/_app.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { UserManagerWrapper } from "@/util/UserManaged"
2-
import "../styles/globals.css"
2+
import "../styles/tailwind.css"
3+
import '@/submodules/tailwind-config/global.css';
34
import { theme, globalStyles, ThemeProps } from "@ory/themes"
45
import type { AppProps } from "next/app"
56
import Head from "next/head"

pages/_document.tsx

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react'
2+
import { Head, Html, Main, NextScript } from 'next/document'
3+
4+
export default function Document(props) {
5+
6+
return (
7+
<Html
8+
className="h-full scroll-smooth bg-white antialiased [font-feature-settings:'ss01']"
9+
lang="en"
10+
>
11+
<Head>
12+
<link rel="preconnect" href="https://fonts.googleapis.com" />
13+
<link
14+
rel="preconnect"
15+
href="https://fonts.gstatic.com"
16+
crossOrigin="anonymous"
17+
/>
18+
<link
19+
rel="stylesheet"
20+
href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Lexend:wght@400;500&display=swap"
21+
/>
22+
<link rel="shortcut icon" href="/refinery/images/refinery-favicon.ico" />
23+
</Head>
24+
<body className="flex h-full flex-col overflow-y-hidden">
25+
<Main />
26+
<NextScript />
27+
</body>
28+
</Html>
29+
)
30+
}

postcss.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
22
plugins: {
33
tailwindcss: {},
4+
'postcss-focus-visible': {
5+
replaceWith: '[data-focus-visible-added]',
6+
},
47
autoprefixer: {},
58
},
69
}

styles/globals.css renamed to styles/tailwind.css

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ html {
1616
-webkit-text-size-adjust: 100%;
1717
-moz-tab-size: 4;
1818
tab-size: 4;
19-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
20-
/* 4 */
2119
}
2220

2321

submodules/tailwind-config

Submodule tailwind-config added at c0d5bb6

tailwind.config.js

+3-39
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,7 @@ const defaultTheme = require('tailwindcss/defaultTheme')
22

33
/** @type {import('tailwindcss').Config} */
44
module.exports = {
5-
content: ['./src/**/*.{js,jsx,ts,tsx}'],
6-
theme: {
7-
fontSize: {
8-
xs: ['0.75rem', { lineHeight: '1rem' }],
9-
sm: ['0.875rem', { lineHeight: '1.5rem' }],
10-
base: ['1rem', { lineHeight: '1.75rem' }],
11-
lg: ['1.125rem', { lineHeight: '2rem' }],
12-
xl: ['1.25rem', { lineHeight: '2rem' }],
13-
'2xl': ['1.5rem', { lineHeight: '2rem' }],
14-
'3xl': ['2rem', { lineHeight: '2.5rem' }],
15-
'4xl': ['2.5rem', { lineHeight: '3.5rem' }],
16-
'5xl': ['3rem', { lineHeight: '3.5rem' }],
17-
'6xl': ['3.75rem', { lineHeight: '1' }],
18-
'7xl': ['4.5rem', { lineHeight: '1.1' }],
19-
'8xl': ['6rem', { lineHeight: '1' }],
20-
'9xl': ['8rem', { lineHeight: '1' }],
21-
},
22-
extend: {
23-
borderRadius: {
24-
'4xl': '2rem',
25-
},
26-
fontFamily: {
27-
sans: ['Inter', ...defaultTheme.fontFamily.sans],
28-
mono: ['DM Mono', ...defaultTheme.fontFamily.mono],
29-
},
30-
maxWidth: {
31-
'2xl': '40rem',
32-
},
33-
},
34-
},
35-
plugins: [require('@tailwindcss/forms')],
36-
content: ['./src/**/*.{js,jsx,ts,tsx}', './submodules/react-components/**/*.{js,jsx,ts,tsx}'],
37-
safelist: [
38-
// new safelist logic https://tailwindcss.com/docs/content-configuration#using-regular-expressions
39-
{ pattern: /(text)-(slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(500|600|700|800)/ },
40-
{ pattern: /(border)-(slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(300|400|500)/ },
41-
{ pattern: /(bg)-(slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(50|100|200|300|500)/ },
42-
{ pattern: /grid-cols-(\d+)/ },
43-
],
5+
presets: [
6+
require('./submodules/tailwind-config/tailwind.config.js'),
7+
]
448
}

0 commit comments

Comments
 (0)