Nucleic Photon Magnetizer

    append-css

    1.1.2 • Public • Published

    append-css

    Circle CI

    Append css rule to document.
    This is wrapper for <style></style> element.

    <script src="./browser/build.js"></script>
    <script>
    const AppendCss = require('append-css');
     
    // append new rule
    let appendedRules = new AppendCss(`
      body {
        background: black;
      }
    `);
     
    // disable rules
    appendedRules.disable();
     
    // change rules
    appendedRules.textContent = `
      body {
        width: 100%;
      }
    `;
     
    // enable rules
    appendedRules.enable();
     
    // dispose appended rules and <style></style> element
    appendedRules.dispose();
    </script> 

    options

    constructor(cssText, options);

    prepend

    Append <style></style> element to before document.head.firstChild.

    { prepend: true }

    Install

    npm i append-css

    DownloadsWeekly Downloads

    43

    Version

    1.1.2

    License

    MIT

    Last publish

    Collaborators

    • all-user