Jan 22nd, 2011, 08:09 PM
Stack Overflow moderator
- Update to v0.8 Critical bug fixes.
- Update to v0.7 Bug fixes and more extensions.
- CSS1 Selectors (By tag name, class name, ID, and parent node trees, although that's a bit different)
- CSS3 Pseudo-classes
- Multi-element CSS changes
- Animation (multiple elements, too!)
- Additional extensions
The CSS1 selectors are a bit different when dealing with ancestor-of selectors. Normally, in CSS, "div p" would be any <p> element under a <div> element. In Syntactic Sugar, it must be a direct child (equivalent to "div > p" in CSS). This is because I found it too complicated and unnecessary to include the relationship selectors (*: general sibling, >: direct child, <: direct parent, ~: general sibling, +: adjacent sibling). If you find it necessary, let me know - I'll move it up on the priority list. I'm working on it.
Here's a syntax example. It takes all <div> elements that are the last <div> element in their parent element that also have the class "blue" but not the class "dontstyle" and colors them blue and italicizes them:
One known bug is that the nth-child, nth-last-child, nth-of-type, and nth-last-of-type selectors do not work with expressions, such as ":nth-last-child(2n+3)". Once again, working on it.
Please enjoy this library and let me know about any bugs, or any features you want added. Attached are the main library, the animation extensions, and an example HTML file. The example HTML is example.txt (VBForums doesn't let you upload HTML files directly) and contains both scripts so people who just want to see what it's like don't have to download a whole ZIP file.
Last edited by minitech; Feb 21st, 2011 at 03:34 PM.
Tags for this Thread
Click Here to Expand Forum to Full Width
Survey posted by VBForums.