This repository has been archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtailwind.typography.config.js
87 lines (86 loc) · 2.1 KB
/
tailwind.typography.config.js
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
/*
Config for our tailwind typography instance
@see https://github.com/tailwindlabs/tailwindcss-typography/blob/master/src/styles.js
*/
const round = (num) =>
num
.toFixed(7)
.replace(/(\.[0-9]+?)0+$/, "$1")
.replace(/\.0$/, "");
const em = (px, base) => `${round(px / base)}em`;
module.exports = (theme) => ({
sm: {
css: {
kdb: {
fontSize: em(12, 14),
},
},
},
DEFAULT: {
css: {
color: theme("colors.gray.100"),
strong: {
color: theme("colors.gray.200"),
},
a: {
color: theme("colors.pink.400"),
textDecoration: "none",
"&:hover": {
color: theme("colors.pink.400"),
textDecoration: "underline",
},
},
kbd: {
color: theme("colors.gray.300"),
fontSize: em(14, 16),
fontWeight: theme("fontWeight.medium"),
backgroundColor: theme("colors.gray.750"),
borderColor: theme("colors.gray.700"),
borderWidth: theme("borderWidth.DEFAULT"),
borderRadius: theme("borderRadius.sm"),
padding: theme("spacing[0.5]"),
},
code: {
color: theme("colors.gray.300"),
fontSize: em(14, 16),
fontWeight: theme("fontWeight.medium"),
backgroundColor: theme("colors.gray.800"),
borderColor: theme("colors.gray.750"),
borderWidth: theme("borderWidth.DEFAULT"),
borderRadius: theme("borderRadius.sm"),
padding: theme("spacing[0.5]"),
"&::before": {
display: "none",
},
"&::after": {
display: "none",
},
},
pre: {
backgroundColor: theme("colors.gray.900"),
},
h2: {
color: theme("colors.gray.300"),
},
h3: {
color: theme("colors.gray.300"),
},
h4: {
color: theme("colors.gray.300"),
},
h5: {
color: theme("colors.gray.300"),
},
ol: {
li: {
"&::before": {
color: theme("colors.gray.300"),
},
},
},
th: {
color: theme("colors.gray.300"),
},
},
},
});