Skip to content

Commit 0b5a4dd

Browse files
committed
fix(focus): fix focus pseudo class
It was being escaped before, causing it to not being applied
1 parent 948fcf5 commit 0b5a4dd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

__tests__/index.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ describe('plugin', () => {
237237
.text-gray-100 {
238238
color: #333333
239239
}
240-
.theme-dark .dark\\:focus\\:text-gray-100\\:focus {
240+
.theme-dark .dark\\:focus\\:text-gray-100:focus {
241241
color: #333333
242242
}
243243
`)
@@ -257,7 +257,7 @@ describe('plugin', () => {
257257
.text-gray-100 {
258258
color: #333333
259259
}
260-
.theme-dark .dark\\:focus\\:text-gray-100\\:focus {
260+
.theme-dark .dark\\:focus\\:text-gray-100:focus {
261261
color: #333333
262262
}
263263
.placeholder-gray-100::placeholder {
@@ -266,7 +266,7 @@ describe('plugin', () => {
266266
.focus\\:placeholder-gray-100:focus::placeholder {
267267
color: #333333
268268
}
269-
.theme-dark .dark\\:focus\\:placeholder-gray-100\\:focus::placeholder {
269+
.theme-dark .dark\\:focus\\:placeholder-gray-100:focus::placeholder {
270270
color: #333333
271271
}
272272
`)

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ module.exports = ({ addVariant, theme, e }) => {
8282
modifySelectors(({ selector }) => {
8383
return selectorParser((selectors) => {
8484
selectors.walkClasses((sel) => {
85-
sel.value = `${tv}${separator}focus${separator}${sel.value}:focus`
85+
sel.value = `${tv}${separator}focus${separator}${sel.value}`
8686
sel.parent.insertBefore(sel, selectorParser().astSync(root))
87+
sel.parent.insertAfter(sel, selectorParser.pseudo({ value: ':focus' }))
8788
})
8889
}).processSync(selector)
8990
})

0 commit comments

Comments
 (0)