Skip to content

Latest commit

 

History

History
52 lines (30 loc) · 1.19 KB

AstFormulaOfSelector.md

File metadata and controls

52 lines (30 loc) · 1.19 KB

css-selector-parser / Exports / AstFormulaOfSelector

Interface: AstFormulaOfSelector

Pseudo-class formula of selector value. a is multiplier of n and b us added on top. Formula: an + b. Formula is followed by of keyword and then goes a CSS selector. For instance :nth-child(2n + 1 of div) -> {type: 'AstPseudoClass'..., argument: {type: 'FormulaOfSelector', a: 2, b: 1, selector: {type: 'Selector', rules: [{type: 'Rule', items: [{type: 'TagName', name: 'div'}]}]}}}. Generated by ast.formulaOfSelector.

See

https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child#functional_notation

Table of contents

Properties

Properties

a

a: number

Multiplier of n.


b

b: number

Constant added to a*n.


selector

selector: AstRule

Selector that goes after formula (i.e. "div -> span" in case of ":nth-child(2n + 1 of div > span)"


type

type: "FormulaOfSelector"