-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtailwind.config.cjs
More file actions
37 lines (33 loc) · 1.21 KB
/
tailwind.config.cjs
File metadata and controls
37 lines (33 loc) · 1.21 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
var flattenColorPalette =
require("tailwindcss/lib/util/flattenColorPalette").default;
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
theme: {
extend: {
fontFamily: {
serif: ["Garamond", "serif"],
sans: ["system-ui", "sans-serif"],
mono: ["Menlo", "Monaco", "Lucida Console", "ans-serif"],
},
},
},
plugins: [
({ addUtilities, e, theme, variants }) => {
let colors = flattenColorPalette(theme("borderColor"));
delete colors["default"];
// Replace or Add custom colors
if (this.theme?.extend?.colors !== undefined) {
colors = Object.assign(colors, this.theme.extend.colors);
}
const colorMap = Object.keys(colors).map((color) => ({
[`.border-t-${color}`]: { borderTopColor: colors[color] },
[`.border-r-${color}`]: { borderRightColor: colors[color] },
[`.border-b-${color}`]: { borderBottomColor: colors[color] },
[`.border-l-${color}`]: { borderLeftColor: colors[color] },
}));
const utilities = Object.assign({}, ...colorMap);
addUtilities(utilities, variants("borderColor"));
},
],
};