Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.62 KB

selectors.md

File metadata and controls

28 lines (21 loc) · 1.62 KB

Selectors

data | schema

CSS Selectors define which elements CSS rulesets will be applied to.

Structure for selectors

A selector object looks like this:

"General sibling selectors": {
  "syntax": "A ~ B",
  "groups": [
    "Combinators"
  ],
  "status": "standard"
}

The three properties shown above are all required:

  • syntax (string): The syntax of the selector (e.g. ::after with two colons indicating a pseudo-element, :hover with one colon indicating a pseudo-class, or A ~ B indicating a combinator).
  • groups (array of strings): CSS is organized in modules like "CSS Values and Units". MDN organizes features in these groups as well — groups should contain the name of the module(s) the selector is defined in.
  • status (enum string): This is either standard, nonstandard, experimental or obsolete depending on the standardization status of the feature.

There is another property that is optional:

  • mdn_url (string): a URL linking to the selector's page on MDN. This URL must omit the localization part of the URL (such as en-US/).