|
1 | 1 | import { fontFamily } from "tailwindcss/defaultTheme"
|
2 | 2 | import type { Config } from "tailwindcss"
|
3 | 3 | import typography from "@tailwindcss/typography"
|
| 4 | +import plugin from "tailwindcss/plugin" |
4 | 5 |
|
5 | 6 | const config: Config = {
|
6 | 7 | content: ["./src/**/*.{js,ts,jsx,tsx,mdx}", "./theme.config.tsx"],
|
@@ -71,7 +72,89 @@ const config: Config = {
|
71 | 72 | },
|
72 | 73 | },
|
73 | 74 | },
|
74 |
| - plugins: [typography], |
| 75 | + plugins: [ |
| 76 | + typography, |
| 77 | + plugin(({ addUtilities }) => { |
| 78 | + const headingStyles = { |
| 79 | + ".typography-d1, .typography-h1, .typography-h2, .typography-h3": { |
| 80 | + lineHeight: "1.2", |
| 81 | + }, |
| 82 | + ".typography-d1": { |
| 83 | + fontSize: "96px", |
| 84 | + "@screen lg": { |
| 85 | + fontSize: "48px", |
| 86 | + }, |
| 87 | + }, |
| 88 | + ".typography-h1": { |
| 89 | + fontSize: "40px", |
| 90 | + "@screen lg": { |
| 91 | + fontSize: "72px", |
| 92 | + }, |
| 93 | + }, |
| 94 | + ".typography-h2": { |
| 95 | + fontSize: "32px", |
| 96 | + "@screen md": { |
| 97 | + fontSize: "48px", |
| 98 | + }, |
| 99 | + }, |
| 100 | + ".typography-h3": { |
| 101 | + fontSize: "24px", |
| 102 | + "@screen md": { |
| 103 | + fontSize: "32px", |
| 104 | + }, |
| 105 | + }, |
| 106 | + } |
| 107 | + |
| 108 | + const bodyStyles = { |
| 109 | + ".typography-body-lg, .typography-body-md, .typography-body-sm, .typography-body-xs": |
| 110 | + { |
| 111 | + lineHeight: "1.5", |
| 112 | + }, |
| 113 | + ".typography-body-lg": { |
| 114 | + fontSize: "16px", |
| 115 | + "@screen md": { |
| 116 | + fontSize: "20px", |
| 117 | + }, |
| 118 | + }, |
| 119 | + ".typography-body-md": { |
| 120 | + fontSize: "14px", |
| 121 | + "@screen md": { |
| 122 | + fontSize: "16px", |
| 123 | + }, |
| 124 | + }, |
| 125 | + ".typography-body-sm": { |
| 126 | + fontSize: "12px", |
| 127 | + "@screen md": { |
| 128 | + fontSize: "14px", |
| 129 | + }, |
| 130 | + }, |
| 131 | + ".typography-body-xs": { |
| 132 | + fontSize: "10px", |
| 133 | + "@screen md": { |
| 134 | + fontSize: "12px", |
| 135 | + }, |
| 136 | + }, |
| 137 | + } |
| 138 | + |
| 139 | + const specialStyles = { |
| 140 | + ".typography-button, .typography-tagline": { |
| 141 | + fontSize: "16px", |
| 142 | + lineHeight: "1", |
| 143 | + }, |
| 144 | + ".typography-tagline": { |
| 145 | + textTransform: "uppercase", |
| 146 | + }, |
| 147 | + ".typography-menu": { |
| 148 | + fontFamily: "var(--font-mono)", |
| 149 | + fontSize: "14px", |
| 150 | + lineHeight: "1", |
| 151 | + textTransform: "uppercase", |
| 152 | + }, |
| 153 | + } |
| 154 | + |
| 155 | + addUtilities({ ...headingStyles, ...bodyStyles, ...specialStyles }) |
| 156 | + }), |
| 157 | + ], |
75 | 158 | darkMode: ["class", 'html[class~="dark"]'],
|
76 | 159 | }
|
77 | 160 | export default config
|
0 commit comments