Help language development. Donate to The Perl Foundation
[Raku CSS Project] / [CSS-Module-CSS3-Selectors]
This module extends CSS::Grammar::CSS3, to implement parsing for CSS Selectors Module Level 3. It provides grammar CSS::Module::CSS3::Selectors
and actions class CSS::Module::CSS3::Selectors::Actions
.
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:
svg|circle
span[class="example"]
tr:nth-child(2n+1)
foo:nth-last-child(odd)
body > h2:not(:first-of-type):not(:last-of-type)