1.0.6 • Published 6 years ago

apply-css v1.0.6

Weekly downloads
6
License
ISC
Repository
github
Last release
6 years ago

apply-css

JavaScript Style Guide

Scoped CSS was a planned web platform feature in multiple browsers but was later retracted due to high code complexity.

With apply-css this is possible in the browser using browserify.

There is a demo project using bootstrap + a theme here. Or see it directly live here.

Usage

apply(element, css)

  • element is the element to apply the css to
  • css is the stylesheet as a string to apply

Example

See the example folder.

Using browserify

With the browserify transfrom brfs it is possible to static-inline the css from a file:

var fs = require('fs')
var cssString = fs.readFileSync('style.css', { encoding: 'utf8' })

Tests

To run the tests simply run npm test.

1.0.6

6 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

9 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

11 years ago