4.6.1 • Published 4 hours ago

@markuplint/selector v4.6.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 hours ago

@markuplint/selector

npm version

Extended W3C Selectors matcher

Supported selectors and operators:

Selector TypeCode ExampleSupport
Universal selector*
Type selectordiv
ID selector#id
Class selector.class
Attribute selector[data-attr]
Attribute selector, Exact match[data-attr=value] [data-attr=value i]
Attribute selector, Include whitespace separated[data-attr~=value] [data-attr~=value i]
Attribute selector, Subcode matchdata-attr|=value data-attr|=value i
Attribute selector, Partial match[data-attr*=value] [data-attr*=value i]
Attribute selector, Forward match[data-attr^=value] [data-attr^=value i]
Attribute selector, Backward match[data-attr$=value] [data-attr$=value i]
Negation pseudo-class:not(div)
Matches-Any pseudo-class:is(div)
Specificity-adjustment pseudo-class:where(div)
Relational pseudo-class:has(div) :has(> div) :has(+ div) :has(~ div)
Directionality pseudo-class:dir(ltr)
Language pseudo-class:lang(en)
Hyperlink pseudo-class:any-link
Link History pseudo-class:link :visited
Local link pseudo-class:local-link
Target pseudo-class:target
Target container pseudo-class:target-within
Reference element pseudo-class:scope
Current-element pseudo-class:current :current(div)
Past pseudo-class:past
Future pseudo-class:future
Interactive pseudo-class:active :hover :focus :focus-within :focus-visible
Enable and disable pseudo-class:enable :disable
Mutability pseudo-class:read-write :read-only
Placeholder-shown pseudo-class:placeholder-shown
Default-option pseudo-class:default
Selected-option pseudo-class:checked
Indeterminate value pseudo-class:indeterminate
Validity pseudo-class:valid :invalid
Range pseudo-class:in-range :out-of-range
Optionality pseudo-class:required :optional
Empty-Value pseudo-class:blank
User-interaction pseudo-class:user-invalid
Root pseudo-class:root
Empty pseudo-class:empty
Nth-child pseudo-class:nth-child(2) :nth-last-child(2) :first-child :last-child :only-child
Nth-child pseudo-class (of El Syntax):nth-child(2 of div) :nth-last-child(2 of div)
Nth-of-type pseudo-class:nth-of-type(2) :nth-last-of-type(2) :first-of-type :last-of-type :only-of-type
Nth-col pseudo-class:nth-col(2) :nth-last-col(2)
Pseudo elements::before ::after
Descendant combinatordiv span
Child combinatordiv > span (:has(> span))
Next-sibling combinatordiv + span (:has(+ span))
Subsequent-sibling combinatordiv ~ span (:has(~ span))
Column combinatordiv || span
Multiple selectorsdiv, span

Extended Selector

The below is selectors that are extended by markuplint:

Selector TypeCode Example
ARIA pseudo-class:aria(has name)
ARIA Role pseudo-class:role(heading)
Content Model pseudo-class:model(interactive)

ARIA pseudo-class

:aria(syntax)
SyntaxExampleDescription
has name:aria(has name)Matches the element has accessible name
has no name:aria(has no name)Matches the element has no accessible name

ARIA Role pseudo-class

:role(roleName)
:role(roleName|version)

For example, :role(button) matches <button> and <div role="button">.

You can specify the version of WAI-ARIA by separating the pipe like :role(form|1.1).

Content Model pseudo-class

:model(interactive)
:model(palpable)

For example, :role(interactive) matches <a>(with href attr), <button>, and so on.

Regex Selector

{
  "nodeName": "/^[a-z]+$/",
  "attrName": "/^[a-z]+$/",
  "attrValue": "/^[a-z]+$/"
}

Install

markuplint package includes this package.

$ npm install @markuplint/selector

$ yarn add @markuplint/selector
4.6.1

4 hours ago

4.6.1-alpha.0

5 hours ago

4.6.0

2 days ago

4.5.1

14 days ago

4.5.0

20 days ago

4.4.0

1 month ago

4.3.1-dev.1

1 month ago

4.3.0

1 month ago

4.2.1-alpha.0

2 months ago

4.2.0

2 months ago

4.1.1

3 months ago

4.1.0

3 months ago

4.0.1

3 months ago

4.0.0-rc.1

3 months ago

4.0.0

3 months ago

4.0.0-alpha.12

3 months ago

4.0.0-rc.0

3 months ago

4.0.0-alpha.11

3 months ago

4.0.0-alpha.10

3 months ago

4.0.0-dev.23

3 months ago

4.0.0-dev.12

3 months ago

4.0.0-alpha.9

4 months ago

4.0.0-alpha.8

4 months ago

4.0.0-alpha.7

4 months ago

4.0.0-dev.20

4 months ago

4.0.0-dev.10

5 months ago

4.0.0-alpha.5

6 months ago

4.0.0-alpha.6

5 months ago

4.0.0-alpha.3

7 months ago

4.0.0-alpha.4

7 months ago

4.0.0-alpha.1

9 months ago

3.0.0-dev.300

7 months ago

4.0.0-alpha.2

7 months ago

3.12.0

7 months ago

4.0.0-dev.0

5 months ago

3.0.0-dev.290

7 months ago

4.0.0-dev.28

7 months ago

3.14.0

5 months ago

3.11.0

10 months ago

3.13.0

7 months ago

3.11.1

8 months ago

3.9.0

1 year ago

3.0.0-dev.186

1 year ago

3.8.0

1 year ago

3.10.0

11 months ago

3.4.0

1 year ago

3.7.0

1 year ago

3.6.1

1 year ago

3.6.0

1 year ago

3.5.0

1 year ago

3.0.0-dev.96

1 year ago

3.0.0-dev.95

1 year ago

3.0.0-dev.177

1 year ago

3.0.0-dev.176

1 year ago

3.3.0

1 year ago

3.0.0-dev.25

1 year ago

3.0.0-dev.24

1 year ago

3.0.0-alpha.6

1 year ago

3.0.0-alpha.5

1 year ago

3.0.0-dev.43

1 year ago

3.0.0-dev.42

1 year ago

3.0.0-dev.40

1 year ago

3.2.0

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0-dev.38

1 year ago

3.0.0-rc.2

1 year ago

3.0.0-rc.1

1 year ago

3.0.0-rc.0

1 year ago

3.0.0

1 year ago

3.0.0-rc.5

1 year ago

3.0.0-rc.4

1 year ago

3.0.0-rc.3

1 year ago

3.0.0-alpha.27

1 year ago

3.0.0-dev.50.40

1 year ago

3.0.0-dev.54

1 year ago

3.0.0-dev.51

1 year ago

3.0.0-alpha.1

2 years ago

3.0.0-alpha.3

2 years ago

3.0.0-alpha.2

2 years ago

3.0.0-alpha.4

2 years ago

3.0.0-alpha.0

2 years ago

3.0.0-alpha.2105

2 years ago