Adding handling for nth-of-type selectors
I got some initial handling for nth-of-type selectors working in this branch. I ended up going a route similar to what @julientaq suggested (parsing the CSS and then adding new attributes to selected elements). It actually seems to be working well (though I ought to write a spec for it, and check out why the pipeline is failing), but I have a few questions for @fchasen re: code conventions and architecture:
- Am I adding the new CSS rules in the correct location (
polisher.styleSheet
)? - Should I use a new classname, instead of a custom attribute? (I just want to make it easy to keep the source content separate from stuff added by paged.)
- Should I set the attribute name to something more human readable? (Just using a
UUID
right now...) - Should this go into a new module? It's not really "paged-media"-specific, but I wasn't sure where else in the folder structure that it might belong.
Any other notes or things you'd do differently?
Edited by Boris Budini