Skip to content

Commit

Permalink
Clean up code style
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Apr 22, 2024
1 parent d378b04 commit a80e446
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ module.exports = (opts = {}) => {
selectors: processSelectors(node.selectors, fixedSelector)
})
if (!removeMedia) {
node.selectors = processSelectors(node.selectors, nodeSelector)
node.selectors = processSelectors(
node.selectors,
nodeSelector
)
}
}
} else if (node.type === 'comment') {
Expand Down
8 changes: 4 additions & 4 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ test('transforms complex nested light-dark()', () => {
`.light-dark-function-mix-a {
color: light-dark(color-mix(in oklch, red, light-dark(cyan, rgb(0, 0, 0))), blue);
}`,
`@media (prefers-color-scheme:dark) {
`@media (prefers-color-scheme:dark) {
:where(html:not(.is-light)) .light-dark-function-mix-a {
color: blue
}
Expand All @@ -731,7 +731,7 @@ test('removes media using transforms complex nested light-dark()', () => {
`.light-dark-function-mix-a {
color: light-dark(color-mix(in oklch, red, light-dark(cyan, rgb(0, 0, 0))), blue);
}`,
`:where(html.is-dark) .light-dark-function-mix-a {
`:where(html.is-dark) .light-dark-function-mix-a {
color: blue
}
:where(html.is-light) .light-dark-function-mix-a {
Expand All @@ -749,8 +749,8 @@ test('removes media with combined queries in the middle - dark scheme', () => {
`@media (width > 0) and (width > 0) {
:where(html.is-dark) a { color: white }
}`,
{ removeMedia: true }
)
{ removeMedia: true }
)
})

test('removes media with combined queries in the middle - light scheme', () => {
Expand Down

0 comments on commit a80e446

Please sign in to comment.