ScoperA polyfill for scoped HTML style elements.
Quick StartJust include
scoper.json your page to start using scoped HTML style elements.
Install via npm:
npm install css-scoper
How It WorksEach
<style scoped>element's parent is wrapped with a
spanthat is given a unique ID. Its rules are moved to
headand all selectors prepended with their respective ID.
Scoper is only active when the page contains scoped styles and the browser doesn't support them.
TestsTests can be run with the command