-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.ts
176 lines (152 loc) · 3.78 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 plugin from "tailwindcss/plugin";
const config: Config = {
content: ["./src/**/*.{astro,js,ts,tsx,md,mdx}"],
darkMode: ["selector", '[data-theme="dark"]'],
corePlugins: {
preflight: false,
// We disable those because they add stuff to the CSS file even when unused
filter: false,
backdropFilter: false,
ringWidth: false,
ringColor: false,
ringOffsetWidth: false,
ringOffsetColor: false,
boxShadow: false,
transform: false,
touchAction: false,
scrollSnapType: false,
borderColor: false, // If we don't disable this, Tailwind will apply a default border color to all the elements
borderOpacity: false,
textOpacity: false,
// Things we might need in the future but disable for now as they also add stuff
fontVariantNumeric: false,
},
theme: {
screens: {
sm: "640px",
md: "768px",
lg: "1024px",
xl: "1280px",
},
extend: {
colors: {
inherit: "inherit",
"light-bg": "#f2f3f5",
"dark-bg": "#27272a",
"light-text": "#09090b",
"dark-text": "#ecf1f9",
"link-color": "#272d6f",
"dark-link-color": "#7089f6",
},
},
},
plugins: [
// eslint-disable-next-line @typescript-eslint/unbound-method
plugin(({ addBase, theme }) => {
addBase({
// Small reset, preflight include a lot of stuff we don't use so let's make our own
"*, ::before, ::after": {
boxSizing: "border-box",
},
html: {
fontSize: "17px",
lineHeight: "1.5",
"@apply text-light-text": {},
},
body: {
"@apply min-h-screen w-full bg-light-bg dark:bg-dark-bg p-2 dark:text-dark-text": {},
},
"body, dl, dd, p": {
margin: "0",
},
":root": {
"-moz-tab-size": "4",
tabSize: "4",
},
// Custom stuff
"html, body": {
fontFamily:
"ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', fallback-arial, 'Arial', 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
},
a: {
textDecoration: "none",
fontWeight: "500",
transition: "color .15s",
"&:hover": {
textDecoration: "underline",
textUnderlinePosition: "from-font",
textDecorationThickness: "2px",
},
"@apply text-link-color dark:text-dark-link-color": {},
},
"h1, h2, h3, h4": {
letterSpacing: "-.01em",
fontWeight: "550",
},
dt: { fontWeight: "bold" },
"dd:not(:last-of-type)": {
marginBottom: "1rem",
},
// Articles
article: {
marginBottom: "3rem",
},
"article p, p, ul, pre, blockquote": {
marginBottom: "1em",
},
"h1, h2": {
marginTop: "1.3rem",
marginBottom: ".6rem",
},
h3: {
marginBottom: ".6rem",
},
"li>p": {
marginBottom: ".6rem",
},
blockquote: {
paddingTop: "0.5rem",
paddingBottom: "0.5rem",
paddingLeft: "1rem",
borderLeft: "5px solid",
borderColor: "#35363A",
backgroundColor: "#D4D4D8",
borderRadius: theme("borderRadius.md"),
fontStyle: "italic",
fontWeight: "450",
marginLeft: "0",
marginRight: "0",
"@apply sm:mx-5 dark:bg-zinc-900": {},
"& p:last-child": {
marginBottom: "0",
},
},
figure: {
marginTop: "1.4rem",
marginBottom: "1rem",
textAlign: "center",
"@apply sm:mx-8 mx-0": {},
},
img: {
maxWidth: "100%",
height: "auto",
borderRadius: theme("borderRadius.md"),
},
figcaption: {
textAlign: "center",
display: "block",
margin: ".15rem 0",
fontStyle: "italic",
fontSize: ".95rem",
"@apply text-zinc-600 dark:text-zinc-400": {},
},
iframe: {
margin: "0 auto 1rem",
display: "block",
},
});
}),
],
};
export default config;