-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtailwind.config.ts
75 lines (67 loc) · 2.99 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
import typographyPlugin from '@tailwindcss/typography';
import type { Config } from 'tailwindcss';
import defaultTheme from 'tailwindcss/defaultTheme';
export default {
darkMode: 'selector',
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue,svg}'],
theme: {
extend: {
spacing: {
15: '3.75rem',
18: '4.5rem',
26: '6.5rem',
50: '12.5rem',
},
colors: {
...getCustomColors(),
},
fontFamily: {
header: ['var(--font-header)', ...defaultTheme.fontFamily.sans],
body: ['var(--font-body)', ...defaultTheme.fontFamily.sans],
},
typography: {
DEFAULT: {
css: {
'--tw-prose-body': 'hsl(var(--text-primary))',
'--tw-prose-headings': 'hsl(var(--text-title))',
'--tw-prose-lead': 'hsl(var(--text-primary))',
'--tw-prose-links': 'hsl(var(--text-title))',
'--tw-prose-bold': 'hsl(var(--text-title))',
'--tw-prose-counters': 'hsl(var(--text-secondary))',
'--tw-prose-bullets': 'hsl(var(--text-secondary))',
'--tw-prose-hr': 'hsl(var(--separator))',
'--tw-prose-quotes': 'hsl(var(--text-title))',
'--tw-prose-quote-borders': 'hsl(var(--border))',
'--tw-prose-captions': 'hsl(var(--text-secondary))',
'--tw-prose-kbd': 'hsl(var(--text-title))',
'--tw-prose-kbd-shadows': 'hsl(var(--text-title))',
'--tw-prose-code': 'hsl(var(--text-title))',
'--tw-prose-pre-code': 'hsl(var(--bg-main))',
'--tw-prose-pre-bg': 'hsl(var(--text-title))',
'--tw-prose-th-borders': 'hsl(var(--separator))',
'--tw-prose-td-borders': 'hsl(var(--border))',
},
},
},
},
},
plugins: [typographyPlugin],
} satisfies Config;
function getCustomColors() {
// Tailwind shades used for base colors.
const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
// Base color palettes used in the project. Related CSS variables are located in `src/styles/colors/(dusk|accent)`.
const baseColors = ['dusk', 'accent'];
// Colors used in the code for styling. Related CSS variables are located in `src/styles/colors/elements`.
// prettier-ignore
const elementColors = ['button-bg', 'button-bg-contrast', 'web-heading-underline', 'pdf-heading-underline', 'primary-dark', 'primary', 'primary-light', 'primary-contrast', 'text-title', 'text-primary', 'text-secondary', 'text-contrast', 'icon-light', 'icon-main', 'icon-dark', 'border', 'separator', 'bg-body', 'bg-card', 'bg-popover', 'bg-tooltip', 'bg-light', 'bg-main', 'bg-dark'];
const result: Record<string, Record<string, string>> = {};
for (const color of baseColors) {
result[color] = Object.fromEntries(shades.map((shade) => [shade, `hsl(var(--${color}-${shade}) / <alpha-value>)`]));
}
result.color = {};
for (const color of elementColors) {
result.color[color] = `hsl(var(--${color}) / <alpha-value>)`;
}
return result;
}