1. style-inject
Inject style tag to document head.
style-inject
Package: style-inject
Created by: egoist
Last modified: Mon, 27 Jun 2022 01:29:12 GMT
Version: 0.3.0
License: MIT
Downloads: 2,916,015
Repository: https://github.com/egoist/style-inject

Install

npm install style-inject
yarn add style-inject

style-inject

NPM version NPM downloads CircleCI donate chat

Inject style tag to document head.

Installation

 npm install style-inject

Example

 import styleInject from 'style-inject';
const css = `
  body {
    margin: 0;
  }
`;
styleInject(css, options);

Options

insertAt

Type: string

Possible values: top

Default: undefined

Insert style tag to specific position of head element.

License

MIT © EGOIST

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code