-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.ts
176 lines (175 loc) Β· 4.62 KB
/
tailwind.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import type { Config } from "tailwindcss";
import { fontFamily } from "tailwindcss/defaultTheme";
import plugin from "tailwindcss/plugin";
import type { PluginAPI } from "tailwindcss/types/config";
export default {
content: ["./src/**/*.{astro,html,js,jsx,md,svelte,ts,tsx,vue}"],
darkMode: "class",
corePlugins: {
// disable aspect ratio as per docs -> @tailwindcss/aspect-ratio
aspectRatio: false,
// disable some core plugins as they are included in the css, even when unused
touchAction: false,
ringOffsetWidth: false,
ringOffsetColor: false,
scrollSnapType: false,
borderOpacity: false,
textOpacity: false,
fontVariantNumeric: false,
},
theme: {
extend: {
colors: {
bgColor: "hsl(var(--theme-bg) / <alpha-value>)",
textColor: "hsl(var(--theme-text) / <alpha-value>)",
link: "hsl(var(--theme-link) / <alpha-value>)",
accent: "hsl(var(--theme-accent) / <alpha-value>)",
"accent-2": "hsl(var(--theme-accent-2) / <alpha-value>)",
quote: "hsl(var(--theme-text) / <alpha-value>)",
"accent-3": "hsl(var(--theme-accent-3) / <alpha-value>)",
"bg-code": "hsl(var(--theme-bg-code) / <alpha-value>)",
},
fontFamily: {
// Add any custom fonts here
sans: ["Inter", ...fontFamily.sans],
serif: [...fontFamily.serif],
code: ["JetBrains Mono", ...fontFamily.mono],
},
transitionProperty: {
height: "height",
},
typography: (theme: PluginAPI["theme"]) => ({
cactus: {
css: {
"--tw-prose-body": theme("colors.textColor / 1"),
"--tw-prose-headings": theme("colors.accent-2 / 1"),
"--tw-prose-links": theme("colors.textColor / 1"),
"--tw-prose-bold": theme("colors.textColor / 1"),
"--tw-prose-bullets": theme("colors.textColor / 1"),
"--tw-prose-quotes": theme("colors.quote / 1"),
"--tw-prose-code": theme("colors.textColor / 1"),
"--tw-prose-hr": theme("colors.textColor / 1"),
"--tw-prose-th-borders": "#666",
},
},
DEFAULT: {
css: {
"a:not(.no-cactus-link)": {
"@apply cactus-link": "",
},
strong: {
"@apply text-link font-bold": "",
},
code: {
fontFamily: theme("fontFamily.code"),
backgroundColor: theme("colors.bg-code / 1"),
borderRadius: "3px",
border: "1px solid",
borderColor: theme("colors.textColor / 0.1"),
padding: "4px",
"&::before": {
content: "none !important",
},
"&::after": {
content: "none !important",
},
},
hr: {
opacity: "0.3",
borderTopStyle: "solid",
},
thead: {
borderBottomWidth: "none",
},
"thead th": {
fontWeight: "700",
borderBottom: "1px dashed #666",
},
"tbody tr": {
borderBottomWidth: "none",
},
tfoot: {
borderTop: "1px dashed #666",
},
sup: {
"@apply ms-0.5": "",
a: {
"@apply bg-none transition-all": "",
"&:hover": {
"@apply text-link no-underline bg-none": "",
},
"&:before": {
content: "'['",
},
"&:after": {
content: "']'",
},
},
},
/** fix checkbox list style */
'ul > li:has(input[type="checkbox"])': {
listStyle: "none",
},
'ul > li > input[type="checkbox"]:first-child': {
margin: "0 8px 0 -22px !important",
},
'ul > li > input[type="checkbox"]': {
position: "relative",
top: "1px",
},
"ul ul": {
margin: "0 !important",
},
"ol ol": {
margin: "0 !important",
},
"li ol": {
margin: "0 !important",
},
"ol li": {
margin: "0 !important",
},
"li ul": {
margin: "0 !important",
},
"ul li": {
margin: "0 !important",
},
},
},
sm: {
css: {
code: {
fontSize: theme("fontSize.sm")?.[0],
fontWeight: "400",
},
},
},
}),
},
},
plugins: [
require("@tailwindcss/typography") /** this breaks tailwind suggestions*/,
require("@tailwindcss/aspect-ratio"),
plugin(function ({ addComponents }) {
addComponents({
".cactus-link": {
"@apply text-link no-underline transition-all duration-300 border-b border-link/10": {},
"&:hover": {
"@apply border-link/100": {},
},
},
".footer-link": {
"@apply text-textColor/50 no-underline transition-all duration-300 border-b border-textColor/10":
{},
"&:hover": {
"@apply border-textColor/50": {},
},
},
".title": {
"@apply text-2xl font-semibold text-accent-2": {},
},
});
}),
],
} satisfies Config;