CSS Level 3 Selectors
Switch branches/tags
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/CSS/Module/CSS3 tidy versioning Jan 23, 2017
t adjustments for latest rakudo Mar 2, 2018
.gitattributes initial checkin Jan 15, 2015
.gitignore adjustments for latest rakudo Mar 2, 2018
.travis.yml panda is extinct Mar 3, 2018
LICENSE add license Apr 24, 2017
META6.json renamed repo May 3, 2017
README.md make it clearer that this module implements parsing only Mar 9, 2018

README.md

perl6-CSS-Module-CSS3-Selectors

This module extends CSS::Grammar::CSS3, to implment parsing for CSS Selectors Module Level 3. It provides grammar CSS::Module::CSS3::Selectors and actions class CSS::Module::CSS3::Selectors::Actions.

Example

use CSS::Module::CSS3::Selectors;
my $actions = CSS::Module::CSS3::Selectors::Actions.new;
CSS::Module::CSS3::Selectors.parse('tr:nth-child(2n+1) span[class="example"]', :rule<selectors>, :$actions);
say $/.ast.perl;

Some of the key extensions are:

  • namespaces: svg|circle
  • attribute selections: span[class="example"]
  • structural selectors: tr:nth-child(2n+1) foo:nth-last-child(odd)
  • negation: body > h2:not(:first-of-type):not(:last-of-type)

See Also