Skip to content

Commit

Permalink
fix(focus): fix focus pseudo class
Browse files Browse the repository at this point in the history
It was being escaped before, causing it to not being applied
  • Loading branch information
estevanmaito committed Jun 12, 2020
1 parent 948fcf5 commit 0b5a4dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ describe('plugin', () => {
.text-gray-100 {
color: #333333
}
.theme-dark .dark\\:focus\\:text-gray-100\\:focus {
.theme-dark .dark\\:focus\\:text-gray-100:focus {
color: #333333
}
`)
Expand All @@ -257,7 +257,7 @@ describe('plugin', () => {
.text-gray-100 {
color: #333333
}
.theme-dark .dark\\:focus\\:text-gray-100\\:focus {
.theme-dark .dark\\:focus\\:text-gray-100:focus {
color: #333333
}
.placeholder-gray-100::placeholder {
Expand All @@ -266,7 +266,7 @@ describe('plugin', () => {
.focus\\:placeholder-gray-100:focus::placeholder {
color: #333333
}
.theme-dark .dark\\:focus\\:placeholder-gray-100\\:focus::placeholder {
.theme-dark .dark\\:focus\\:placeholder-gray-100:focus::placeholder {
color: #333333
}
`)
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ module.exports = ({ addVariant, theme, e }) => {
modifySelectors(({ selector }) => {
return selectorParser((selectors) => {
selectors.walkClasses((sel) => {
sel.value = `${tv}${separator}focus${separator}${sel.value}:focus`
sel.value = `${tv}${separator}focus${separator}${sel.value}`
sel.parent.insertBefore(sel, selectorParser().astSync(root))
sel.parent.insertAfter(sel, selectorParser.pseudo({ value: ':focus' }))
})
}).processSync(selector)
})
Expand Down

1 comment on commit 0b5a4dd

@vercel
Copy link

@vercel vercel bot commented on 0b5a4dd Jun 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.