Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit f84dcfd

Browse files
committed
Only match exact classes using static plugins
1 parent 11b3455 commit f84dcfd

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

src/lib/generateRules.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ function* resolveMatches(candidate, context) {
190190
matches.push([{ ...sort, options: { ...sort.options, ...options } }, rule])
191191
}
192192
}
193-
} else {
193+
}
194+
// Only process static plugins on exact matches
195+
else if (modifier === 'DEFAULT') {
194196
let ruleSet = plugin
195197
let [rules, options] = parseRules(ruleSet, context.postCssNodeCache)
196198
for (let rule of rules) {

tests/01-basic-usage.test.css

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,6 @@
143143
.inline-grid {
144144
display: inline-grid;
145145
}
146-
.inline {
147-
display: inline;
148-
}
149-
.flex {
150-
display: flex;
151-
}
152-
.grid {
153-
display: grid;
154-
}
155-
.table {
156-
display: table;
157-
}
158146
.hidden {
159147
display: none;
160148
}
@@ -269,9 +257,6 @@
269257
.resize-none {
270258
resize: none;
271259
}
272-
.resize {
273-
resize: both;
274-
}
275260
.list-inside {
276261
list-style-position: inside;
277262
}
@@ -299,9 +284,6 @@
299284
.flex-row-reverse {
300285
flex-direction: row-reverse;
301286
}
302-
.flex-row {
303-
flex-direction: row;
304-
}
305287
.flex-wrap {
306288
flex-wrap: wrap;
307289
}

tests/05-prefix.test.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<div class="tw-btn-prefix"></div>
44
<div class="tw-custom-util-prefix"></div>
55
<div class="custom-util-no-prefix"></div>
6+
<div class="custom-component"></div>
67
<div class="tw-custom-component-prefix"></div>
78
<div class="custom-component-no-prefix"></div>
89
<div class="tw-font-bold"></div>

0 commit comments

Comments
 (0)