Socket
Socket
Sign inDemoInstall

attach-css

Package Overview
Dependencies
9
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    attach-css

Localizes CSS based on a virtual DOM tree.


Version published
Maintainers
1
Created

Readme

Source

attach-css

Localizes CSS based on a virtual DOM tree.

build status NPM version experimental

Sauce Test Status

example

var attachCSS = require('attach-css')
var createElement = require('base-element')

var button = createElement(document.body)
var vtree = button.render(function () {
  return this.html('button', {
    className: 'my-button'
  }, 'click me')
})

var css = attachCSS('button { cursor: pointer; }', vtree)
// css will equal: button.my-button { cursor: pointer; }

api

attachCSS(src, vtree[, options])

  • src - A string of CSS to localize.
  • vtree - A virtual DOM tree to localize against.
  • options - Options to use when parsing/stringifying the CSS. See https://www.npmjs.com/package/css.

license

(c) 2015 Kyle Robinson Young. MIT License

Keywords

FAQs

Last updated on 20 May 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc