Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mastodon
GitHub Repository: mastodon/joinmastodon
Path: blob/main/tailwind.config.js
1006 views
1
const plugin = require("tailwindcss/plugin")
2
const defaultTheme = require("tailwindcss/defaultTheme")
3
4
function rem(px) {
5
return `${px / 16}rem`
6
}
7
8
/** @type {import('tailwindcss').Config} */
9
const config = {
10
content: [
11
"./pages/**/*.{js,ts,jsx,tsx}",
12
"./components/**/*.{js,ts,jsx,tsx}",
13
"./donate/**/*.{js,ts,jsx,tsx}",
14
],
15
darkMode: "selector",
16
theme: {
17
fontSize: {
18
h1: rem(68),
19
h2: rem(50),
20
h3: rem(42),
21
h4: rem(38),
22
h5: rem(28),
23
h6: rem(22),
24
sh1: rem(22),
25
b1: rem(20),
26
b2: rem(16),
27
b3: rem(14),
28
b4: rem(12),
29
c2: rem(9),
30
c3: rem(6),
31
},
32
lineHeight: {
33
h1: "calc(75 / 68)",
34
h2: "calc(55 / 50)",
35
h3: "calc(55 / 42)",
36
h4: "calc(50 / 38)",
37
h5: "calc(38 / 28)",
38
h6: "calc(30 / 22)",
39
sh1: "calc(30 / 22)",
40
b1: "calc(30 / 20)",
41
b2: "calc(24 / 16)",
42
b3: "calc(17 / 14)",
43
b4: "calc(17 / 12)",
44
c2: "calc(19 / 9)",
45
c3: "calc(17 / 6)",
46
},
47
colors: {
48
black: "#000000",
49
gray: {
50
0: "#333333",
51
1: "#555555",
52
2: "#9b9b9b",
53
3: "#d4d4d4",
54
4: "#f3f3f3",
55
5: "#f6f6f6",
56
},
57
white: "#ffffff",
58
nightshade: {
59
50: "#fcefff",
60
100: "#BD8DC8",
61
300: "#834491",
62
600: "#4E155A",
63
900: "#1d0023", // "main"
64
},
65
eggplant: "#17063b",
66
blurple: {
67
300: "#858afa",
68
500: "#6364ff",
69
600: "#563acc", // "main"
70
900: "#2f0c7a",
71
},
72
lime: "#baff3b",
73
goldenrod: "#ffbe2e",
74
error: "#ff4d4f",
75
},
76
fill: {
77
current: "currentColor",
78
},
79
extend: {
80
fontFamily: {
81
sans: [
82
"Manrope",
83
"-apple-system",
84
"BlinkMacSystemFont",
85
'"Segoe UI"',
86
"Roboto",
87
'"Helvetica Neue"',
88
"Arial",
89
'"Noto Sans"',
90
"sans-serif",
91
'"Apple Color Emoji"',
92
'"Segoe UI Emoji"',
93
'"Segoe UI Symbol"',
94
'"Noto Color Emoji"',
95
],
96
},
97
boxShadow: {
98
input: "0 0 0 3px #6364ff40, 0 0 0 1px #6364ff",
99
},
100
fontWeight: {
101
extranormal: 450,
102
},
103
letterSpacing: {
104
semiwide: ".01em",
105
},
106
backgroundImage: {
107
"blurple-gradient": `linear-gradient(0deg, #563acc 12.87%, #6364ff 88.62%)`,
108
"overlay-gradient": `linear-gradient(180deg, rgba(29,0,35, 0) 12.87%, rgba(29,0,35, 1) 100%)`,
109
},
110
gap: {
111
gutter: "var(--gutter-width)",
112
},
113
maxWidth: {
114
site: "90rem",
115
},
116
spacing: {
117
26: "6.5rem",
118
"footer-offset": "var(--footer-offset)",
119
},
120
dropShadow: {
121
/** Used for text on hero images that may shift around */
122
"safe-text": "0 0 30px #1d0023",
123
},
124
},
125
},
126
plugins: [
127
/** CSS Logical Properties https://github.com/stevecochrane/tailwindcss-logical */
128
require("tailwindcss-logical"),
129
plugin(function ({ addVariant }) {
130
/** A good default for hover states */
131
addVariant("hocus", ["&:hover", "&:focus-visible"])
132
/** Focus-visible inside of presentational containers */
133
addVariant("focus-visible-within", ["&:has(:focus-visible)"])
134
}),
135
],
136
}
137
138
module.exports = {
139
...config,
140
safelist: [
141
// needed for /guide
142
...Object.keys(config.theme.fontSize),
143
...Object.keys(config.theme.colors).reduce((arr, k) => {
144
if (typeof config.theme.colors[k] === "string") {
145
arr.push(`bg-${k}`)
146
return arr
147
} else {
148
return arr.concat(
149
Object.keys(config.theme.colors[k]).map((s) => `bg-${k}-${s}`)
150
)
151
}
152
}, []),
153
],
154
}
155
156