Socket
Socket
Sign inDemoInstall

style2js

Package Overview
Dependencies
4
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    style2js

Let you import css stylesheet via js when no css loader is available


Version published
Weekly downloads
177
increased by164.18%
Maintainers
1
Install size
68.0 MB
Created
Weekly downloads
 

Readme

Source

Style2js

Generate helpers to inject your css into the dom when no css loader is available.

For example the command below will output 3 files into your dist folder

style2js style.min.css --out-dir ./dist
|_ inject-style.js
|_ inject-style.esm.js
|_ inject-style.d.ts

When someone use your library, he can do the following to load the css

import { injectStyle } from "your-library/inject-style";
// inject the stylesheet into the dom
injectStyle();

Installation

You can install the package with npm or yarn

npm i style2js
// with yarn
yarn add style2js

Or use it directly via npx

npx style2js

FAQs

Last updated on 16 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc