-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.js
105 lines (101 loc) · 2.82 KB
/
tailwind.config.js
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
/** @type {import('tailwindcss').Config} */
import flattenColorPalette from 'tailwindcss/lib/util/flattenColorPalette';
import { useColors } from './composables/useColors';
const { generateDefaultColors } = useColors();
const palette = generateDefaultColors();
export default {
content: ['./components/**/*.{ts,vue}', './*.md'],
theme: {
screens: {
'-lg': { max: '1280px' },
'-md': { max: '960px' },
'-sm': { max: '720px' },
'-xs': { max: '540px' },
'-xxs': { max: '320px' },
lg: { min: '1281px' },
md: { min: '961px' },
sm: { min: '721px' },
xs: { min: '541px' },
xxs: { min: '321px' },
'except-touch': { raw: '(hover: hover) and (pointer: fine)' }, // block hovering effect on touch device
},
},
plugins: [
({ addUtilities, matchUtilities, theme }) => {
// Add custom typo classes
addUtilities({
'.wc-base': {
fontSize: '16px',
},
'.wc-bg': {
backgroundColor: palette.background,
},
'.wc-active-bg': {
backgroundColor: palette.activeBackground,
},
'.wc-active-hover-bg': {
backgroundColor: palette.activeHoverBackground,
},
'.wc-active-text': {
color: palette.activeBackground,
},
'.wc-text': {
color: palette.text,
},
'.wc-border': {
border: `2px solid ${palette.border} `,
},
'.wc-rounded': {
borderRadius: '12px',
},
'.wc-focus': {
outline: 'none',
boxShadow: `0 0 0 4px ${palette.focusShadow}`,
border: `2px solid ${palette.border}`,
},
'.wc-error-border': {
outline: 'none',
border: `2px solid ${palette.errorBorder} !important`,
boxShadow: `0 0 0 4px ${palette.errorShadow} !important`,
},
'.wc-error-text': {
color: palette.errorText,
},
'.wc-hover-bg': {
backgroundColor: palette.hoverBackground,
},
'.wc-disabled-text': {
color: palette.disabledText,
},
'.wc-disabled-bg': {
backgroundColor: palette.disabledBackground,
},
'.wc-disabled-path': {
path: {
fill: palette.disabledBackground,
stroke: palette.disabledBorder,
},
},
'.wc-disabled-border': {
border: `${palette.disabledBorder} 2px solid`,
},
'.wc-shadow': {
'box-shadow': '0px 0px 3px rgba(0, 0, 0, 0.25)',
},
});
matchUtilities(
{
path: (value) => ({
path: {
fill: value,
},
}),
},
{
values: flattenColorPalette(theme('colors')),
type: 'color',
},
);
},
],
};