From 3c944f77c9bf0bee59775a98cd6dad58415a7594 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Sat, 15 Nov 2014 21:29:53 +0100 Subject: [PATCH] Added pseudo class syntax to CSS spec. --- doc/css_selectors.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/css_selectors.md b/doc/css_selectors.md index f281a0f..fa48f59 100644 --- a/doc/css_selectors.md +++ b/doc/css_selectors.md @@ -837,6 +837,29 @@ Example XML: Using the CSS selector `root :empty` would return a set containing only the `` node. +### Syntax + +The syntax of the various pseudo classes is as following: + + integer = ('+' | '-')* [0-9]+; + + odd = 'odd'; + even = 'even'; + nth = 'n'; + + pseudo_arg_interval = '-'* integer* nth; + pseudo_arg_offset = ('+' | '-')* integer; + + pseudo_arg = odd + | even + | '-'* nth + | integer + | pseudo_arg_interval + | pseudo_arg_interval pseudo_arg_offset; + + # The `identifier` rule is the same as the one used for element names. + pseudo = ':' identifier ('(' space* pseudo_arg space* ')')*; + [w3spec]: http://www.w3.org/TR/css3-selectors/ [rfc-2119]: https://www.ietf.org/rfc/rfc2119.txt [kramdown]: http://kramdown.gettalong.org/