-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.mjs
147 lines (141 loc) · 4.38 KB
/
tailwind.config.mjs
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
/** @type {import('tailwindcss').Config} */
export default {
// Configuration of files where Tailwind will look for classes
content: ['./src/**/*.{astro,html,js,jsx,ts,tsx}'],
// Base theme extension
theme: {
extend: {
colors: {
primary: {
light: '#FDE2E2', // Soft Blush Pink
DEFAULT: '#F8AFAF', // Rose Pink
dark: '#E47676', // Deep Rose
},
secondary: {
light: '#FFF4CC', // Pale Gold
DEFAULT: '#F0B76D', // Rich Gold (warmer and elegant)
dark: '#B8893A', // Deep Golden Brown
},
accent: {
light: '#FDE8C5', // Light Peach Beige
DEFAULT: '#F6B99E', // Soft Peach
dark: '#DE8976', // Muted Coral
},
neutral: {
lightest: '#FFFFFF', // White
light: '#F5F5F5', // Light Gray
medium: '#E1E1E1', // Medium Gray
dark: '#7A7A7A', // Charcoal Gray
darkest: '#404040', // Dark Gray
},
background: {
DEFAULT: '#FFFFFf', // Warm off-white
alt: '#FFFFFF', // Creamy Peach
},
text: {
DEFAULT: '#2D2D2D', // Almost Black
light: '#5A5A5A', // Soft Dark Gray
},
whatsapp: {
DEFAULT: '#25D366', // WhatsApp Green
hover: '#20b157', // Darker WhatsApp Green for hover
},
},
textShadow: {
lg: '2px 2px 4px rgba(0, 0, 0, 0.1)', // Large subtle shadow
},
backdropBlur: {
xs: '2px',
sm: '4px',
md: '8px',
lg: '12px',
xl: '16px',
},
},
},
// Custom plugins
plugins: [
function ({ addBase, addUtilities, theme }) {
// Custom utilities for text shadows
const textShadowUtilities = {
'.shadow-text-light': { textShadow: '2px 2px 4px rgba(0, 0, 0, 0.3)' },
'.shadow-text': { textShadow: '2px 2px 4px rgba(0, 0, 0, 0.5)' },
'.shadow-text-dark': { textShadow: '2px 2px 4px rgba(0, 0, 0, 0.8)' },
};
// Custom utilities for blurs
const backgroundBlurUtilities = {
'.bg-blur-overlay': {
backdropFilter: 'blur(8px)', // Soft glass-like blur for backgrounds
},
'.bg-blur-soft': {
backdropFilter: 'blur(4px)', // Light blur for subtle background effects
},
'.bg-blur-intense': {
backdropFilter: 'blur(16px)', // More pronounced blur for strong focus separation
},
};
// Custom CSS variables
const cssVariables = {
':root': {
'--primary-light': theme('colors.primary.light'),
'--primary-default': theme('colors.primary.DEFAULT'),
'--primary-dark': theme('colors.primary.dark'),
'--secondary-light': theme('colors.secondary.light'),
'--secondary-default': theme('colors.secondary.DEFAULT'),
'--secondary-dark': theme('colors.secondary.dark'),
'--accent-light': theme('colors.accent.light'),
'--accent-default': theme('colors.accent.DEFAULT'),
'--accent-dark': theme('colors.accent.dark'),
'--neutral-lightest': theme('colors.neutral.lightest'),
'--neutral-light': theme('colors.neutral.light'),
'--neutral-medium': theme('colors.neutral.medium'),
'--neutral-dark': theme('colors.neutral.dark'),
'--neutral-darkest': theme('colors.neutral.darkest'),
'--background-default': theme('colors.background.DEFAULT'),
'--background-default-rgb': '255, 255, 255',
'--background-primary-rgb': '228, 118, 118',
'--background-alt': theme('colors.background.alt'),
'--text-default': theme('colors.text.DEFAULT'),
'--text-light': theme('colors.text.light'),
'--whatsapp': theme('colors.whatsapp.DEFAULT'),
'--whatsapp-hover': theme('colors.whatsapp.hover'),
},
};
// Add utilities and variables to the theme
addBase(cssVariables);
addUtilities(textShadowUtilities);
addUtilities(backgroundBlurUtilities);
},
],
// Safelist to prevent class purging
safelist: [
...(() => {
const colors = [
'primary',
'secondary',
'accent',
'neutral',
'background',
'text',
'whatsapp',
];
const shades = ['light', 'dark', 'DEFAULT', 'alt', 'lightest', 'medium', 'darkest'];
const utilities = ['bg', 'text', 'border', 'hover:bg', 'hover:text', 'hover:border'];
return colors.flatMap((color) =>
shades.flatMap((shade) =>
utilities.map((utility) =>
shade === 'DEFAULT'
? `${utility}-${color}`
: `${utility}-${color}-${shade}`,
),
),
);
})(),
'bg-blur-overlay',
'bg-blur-soft',
'bg-blur-intense',
...['', 'sm:', 'md:', 'lg:', 'xl:'].flatMap((bp) =>
Array.from({ length: 12 }, (_, i) => `${bp}grid-cols-${i + 1}`),
),
],
};