Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Explicitly disallow multiple selector arbitrary variants
Now that we parse them correctly we can restrict them to explicitly supporting only a single selector
  • Loading branch information
thecrypticace committed Feb 22, 2023
commit 63a99536868d4ac6ec35826c38dc7ec5f3492c13
5 changes: 5 additions & 0 deletions src/lib/generateRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ function applyVariant(variant, matches, context) {
let selector = normalize(variant.slice(1, -1))
let selectors = splitAtTopLevelOnly(selector, ',')

// We do not support multiple selectors for arbitrary variants
if (selectors.length > 1) {
return []
}

if (!selectors.every(isValidVariantFormatString)) {
return []
}
Expand Down