Scoped CSS is a new feature that makes it possible to add
<style> elements anywhere in your document, scoping the CSS rules it contains to its parent element. This was just what we needed while developing Snowball.
Unfortunately, support is limited to Firefox, and existing polyfills like scoped-polyfill and jQuery-Scoped-CSS weren’t working quite the way we needed. So I ended up creating a new polyfill for our project, which I’ve made available on GitHub.
To use Scoper, simply include scoper.js on your page.
How Scoper works is that for each
<style scoped> element, the parent (or scoping) element is wrapped with a new element that’s been assigned a unique ID. This ID is prepended to all of its selectors.
Scoper should work in Chrome, Safari, and IE9+, with tests built using Mocha.