Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thomaspark/scoper

A polyfill for scoped HTML styles elements
https://github.com/thomaspark/scoper

css polyfill scoped scoper style

Last synced: about 2 months ago
JSON representation

A polyfill for scoped HTML styles elements

Awesome Lists containing this project

README

        

# Scoper

A polyfill for scoped HTML style elements.

* [Demo](http://jsfiddle.net/thomaspark/rpe402LL/)

# Quick Start

Just include `scoper.js` on your page to start using scoped HTML style elements.

Install via [npm](https://www.npmjs.com/package/css-scoper): `npm install css-scoper`

# How It Works

Each `` element's parent is wrapped with a `span` that is given a unique ID. Its rules are moved to `head` and all selectors prepended with their respective ID.

Scoper is only active when the page contains scoped styles and the browser doesn't support them.

# Tests

Tests can be run with the command `mocha test/test.js`.