dom-restyle
v0.0.2
Published
Easily re-style parts of a webpage
Downloads
5
Readme
dom-restyle
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 (....)
Author
- Vittorio Zaccaria
License
Copyright (c) 2015 Vittorio Zaccaria Released under the license
This file was generated by verb-cli on April 23, 2015.