Skip to content

Commit

Permalink
[CSS] Organize anb pseudo class names in variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Jul 11, 2024
1 parent 16d2234 commit ef0cdc5
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions CSS/CSS.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ variables:
pseudo_classes_with_selector_args: |-
(?xi: global | local | matches | is | where | not | has | host(?:-context)?)
pseudo_classes_with_anb_args: |-
(?xi:
# https://drafts.csswg.org/selectors-4/#table-pseudos
nth-last-col
| nth-col
# https://drafts.csswg.org/selectors-4/#typed-child-index
| nth-last-child
| nth-child
| nth-last-of-type
| nth-of-type
)
# Combinators
# https://drafts.csswg.org/selectors-4/#combinators
combinators: (?:>{1,3}|[~+]|\|{2})
Expand Down Expand Up @@ -1364,17 +1376,7 @@ contexts:
# Functional Pseudo Classes with `An+B` param
# An+B Notation: https://drafts.csswg.org/css-syntax/#anb
pseudo-class-function-with-anb-args:
- match: |-
(?xi:
# https://drafts.csswg.org/selectors-4/#table-pseudos
nth-last-col
| nth-col
# https://drafts.csswg.org/selectors-4/#typed-child-index
| nth-last-child
| nth-child
| nth-last-of-type
| nth-of-type
)(?=\()
- match: '{{pseudo_classes_with_anb_args}}(?=\()'
scope: meta.function-call.identifier.css entity.other.pseudo-class.css
set:
- pseudo-class-anb-arguments-list-body
Expand Down

0 comments on commit ef0cdc5

Please sign in to comment.