0.0.4 • Published 2 years ago

dv-style-inject v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

dv-style-inject

append style target to head

Installation

npm i dv-style-inject

Usage

import { styleInject } from "dv-style-inject";

const css = `
.css {
    color: white;
}
`;

styleInject({
  css: css,
});

Options

{
  /**
   * content of style to append to head
   */
  css: string;
  /**
   * skip or cover if style with unique is exist
   */
  repeat?: "skip" | "cover";
  /**
   * set the style unique string, if pass this argument, the old style target which has same unique will delete
   */
  unique?: string;
}

License

Licensed under the MIT license