CSS Selectors Level 4 link Prollyfills
CSS Selectors Level 4 link Prollyfills
Prollyfills (speculative polyfills) for CSS link/target pseudo-classes currently proposed in CSS Selectors Level 4 Draft as of http://www.w3.org/TR/2011/WD-selectors4-20110929/. They are author named, rather than vendor prefixed so you can use them in a website today with a single prefix, get experience using them, contribute and not worry about your site breaking out from underneath you as a spec evolves - you lock in to what you wrote against, just like you would with any library in any other language. The path to native should be easy should the spec get implemented.
Here are some links that explain:
These prollyfills are plugins for the HitchJS CSS Prollyfill Engine... Use it like this:
<!-- include hitch -->
<script src="//www.hitchjs.com/dist/hitch-0.6.3.js"></script>
<!-- mark a style or link tag with the data-hitch interpret attribute -->
<style data-hitch-interpret>
/* use hitch requires to grab a versioned/tagged plugin */
@-hitch-requires //rawgithub.com/bkardell/selectors-L4-link-prollyfills/v0.1/src/link-prollyfills.js;
/* start using it...
prollyfills are prefixed for forward compatibility, they are experimental, but non-breaking...
*/
p:-links-target() {
background-color: yellow;
}
a:-links-local(1) {
background-color: green;
}
</style>
Sure, here are some simple demos...
Want even better ways forward? See extensiblewebmanifesto.org and #extendthewebforward.