Version 0.3.0
Pre-release
Pre-release
nth
selectors are now supported π
This includes:
:first-child
:nth-child
:last-child
:first-of-type
:nth-of-type
:last-of-type
This also introduces a new "fill" behaviour where missing elements are filled in up to the desired nth
level. For example:
article section:nth-child(5) p {
content: 'Fifth section.';
font-style: italic;
}
Will produce:
<article>
<section></section>
<section></section>
<section></section>
<section></section>
<section>
<p>Fifth section.</p>
</section>
</article>
Filling in these missing elements allows nth
selector styles to still be applied, regardless of neighbouring elements.
This behaviour can be prevented by calling with fill
set to 'no-fill'
:
cssToHtml(css, { fill: 'no-fill' });
Note: Cascading is always maintained.