insert-css

WebJar for insert-css

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

insert-css
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

insert-css
WebJar for insert-css
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/substack/insert-css

Download insert-css

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/insert-css/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>insert-css</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/insert-css/
implementation 'org.webjars.npm:insert-css:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/insert-css/
implementation ("org.webjars.npm:insert-css:2.0.0")
'org.webjars.npm:insert-css:jar:2.0.0'
<dependency org="org.webjars.npm" name="insert-css" rev="2.0.0">
  <artifact name="insert-css" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='insert-css', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "insert-css" % "2.0.0"
[org.webjars.npm/insert-css "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

NPM version

insert-css

insert a string of css into the <head>

browser support

example

    var insertCss = require('insert-css');
    var styleElement = insertCss('body { background:blue; }');

api

    var insertCss = require('insert-css');

var styleElement = insertCss(css, opts);

Insert some CSS into the page.

  • opts.container - Which HTMLElement to use as the base mounting point, defaults to document.querySelector('head').

  • opts.prepend - Add the CSS at the top level of the container instead of at the bottom level (default).

This is particullary useful for library creators where you may want your default CSS to be prepended so it can be easily overriden by user styles.

development

example

npm run example

test

npm test

Versions

Version
2.0.0