CSS Level 3 Selectors
Perl6
Switch branches/tags
Nothing to show
Latest commit 0ce689e May 4, 2017 @dwarring dwarring renamed repo
Permalink
Failed to load latest commit information.
lib/CSS/Module/CSS3
t
.gitattributes
.gitignore
.travis.yml
LICENSE
META6.json
README.md

README.md

perl6-CSS-Module-CSS3-Selectors

This module extends CSS::Grammar::CSS3, to fully implement 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