-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtailwind.config.js
More file actions
51 lines (49 loc) · 1.57 KB
/
tailwind.config.js
File metadata and controls
51 lines (49 loc) · 1.57 KB
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
/**
* tailwind.config.js for Lossless Astro site
*
* Custom theme extension using `lossless-theme.extend.colors` as requested.
* This maps Tailwind color utilities to CSS variables defined in lossless-theme.css.
*
* To use these colors in components, use classes like `text-primary-600` or `bg-primary-400`.
*
* Aggressive commenting: Documented mapping and usage pattern for maintainers.
*/
const plugin = require('tailwindcss/plugin');
module.exports = {
content: [
'./src/**/*.{astro,js,jsx,ts,tsx,vue,svelte}',
'./public/**/*.html',
'./src/styles/**/*.css',
],
safelist: [
'md:grid-cols-1',
'md:grid-cols-2',
'md:grid-cols-3',
'md:grid-cols-4',
// ...add as many as you might use
],
theme: {
// DO NOT use theme.extend.colors here, use custom key as requested
'lossless-theme': {
extend: {
colors: {
'primary-600': 'var(--clr-lossless-primary-600)',
'primary-400': 'var(--clr-lossless-primary-400)',
// Add additional custom palette colors here as needed
},
},
},
},
plugins: [
// Example: Add a plugin to expose the custom color classes if needed
plugin(function({ addUtilities, theme, e }) {
const newUtilities = {};
const colors = theme('lossless-theme.extend.colors', {});
Object.entries(colors).forEach(([key, value]) => {
newUtilities[`.text-${e(key)}`] = { color: value };
newUtilities[`.bg-${e(key)}`] = { backgroundColor: value };
});
addUtilities(newUtilities, ['responsive', 'hover', 'dark']);
}),
],
};