forked from htmlstreamofficial/preline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.js
141 lines (128 loc) · 4.59 KB
/
plugin.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
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
/*
* Plugin
* @version: 1.3.0
* @author: HtmlStream
* @requires: tailwindcss ^3.1.2
* @license: Licensed under MIT (https://preline.co/docs/license.html)
* Copyright 2023 Htmlstream
*/
const plugin = require('tailwindcss/plugin');
module.exports = plugin(function ({ addVariant, e }) {
addVariant('hs-dropdown-open', [
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-dropdown.open > .${e(`hs-dropdown-open${separator}${className}`)}`;
});
},
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-dropdown.open > .hs-dropdown-menu > .${e(`hs-dropdown-open${separator}${className}`)}`;
});
},
]);
addVariant('hs-removing', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-removing.${e(`hs-removing${separator}${className}`)}`;
});
});
addVariant('hs-tooltip-shown', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-tooltip.show .${e(`hs-tooltip-shown${separator}${className}`)}`;
});
});
addVariant('hs-accordion-active', [
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-accordion.active.${e(`hs-accordion-active${separator}${className}`)}`;
});
},
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-accordion.active > .hs-accordion-toggle .${e(`hs-accordion-active${separator}${className}`)}`;
});
},
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-accordion.active > .hs-accordion-toggle.${e(`hs-accordion-active${separator}${className}`)}`;
});
},
]);
addVariant('hs-collapse-open', [
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-collapse.open .${e(`hs-collapse-open${separator}${className}`)}`;
});
},
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-collapse.open.${e(`hs-collapse-open${separator}${className}`)}`;
});
},
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-collapse-toggle.open .${e(`hs-collapse-open${separator}${className}`)}`;
});
},
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-collapse-toggle.open.${e(`hs-collapse-open${separator}${className}`)}`;
});
},
]);
addVariant('hs-tab-active', [
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `[data-hs-tab].active.${e(`hs-tab-active${separator}${className}`)}`;
});
},
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `[data-hs-tab].active .${e(`hs-tab-active${separator}${className}`)}`;
});
},
]);
addVariant('hs-overlay-open', [
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.open.${e(`hs-overlay-open${separator}${className}`)}`;
});
},
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.open .${e(`hs-overlay-open${separator}${className}`)}`;
});
},
]);
addVariant('hs-overlay-backdrop-open', [
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-overlay-backdrop.${e(`hs-overlay-backdrop-open${separator}${className}`)}`;
});
},
({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.hs-overlay-backdrop .${e(`hs-overlay-backdrop-open${separator}${className}`)}`;
});
},
]);
addVariant('hs-dark-mode-active', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.dark .${e(`hs-dark-mode-active${separator}${className}`)}`;
});
});
addVariant('hs-auto-mode-active', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.auto .${e(`hs-auto-mode-active${separator}${className}`)}`;
});
});
addVariant('hs-scrollspy-active', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.active.${e(`hs-scrollspy-active${separator}${className}`)}`;
});
});
addVariant('hs-default-mode-active', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.default .${e(`hs-default-mode-active${separator}${className}`)}`;
});
});
});