Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apply-css

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apply-css

Apply css only to a specific part of the document

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

Keywords

FAQs

Package last updated on 05 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc