dom-restyle

0.0.2 • Public • Published

dom-restyle NPM version

Install globally with npm:

npm i -g dom-restyle

What is it

This module wraps all the elements specified by the query selector into a shadow-dom, by applying the css style specified.

Example

Suppose you want to restyle back to default all the pre elements in an existing page and change the color to red, then:

var { restyle } = require('dom-restyle') /* Browserify */
restyle('pre', '<style>pre {color: red;}</style>')

done. easy.

API

The module exports just one function:

var { restyle } = require('dom-restyle')

restyle(querySelector, css)

Restyles all the elements ref'd by querySelector with the Css. Keep in mind that this modifies the DOM by creating a Shadow host and it is not idempotent.

Params:

  • string querySelector Element to restyle
  • string css Inlined Css style (<style>....</style>)

Author

  • Vittorio Zaccaria

License

Copyright (c) 2015 Vittorio Zaccaria Released under the license


This file was generated by verb-cli on April 23, 2015.

Readme

Keywords

none

Package Sidebar

Install

npm i dom-restyle

Weekly Downloads

1

Version

0.0.2

License

BSD

Last publish

Collaborators

  • vzaccaria