Socket
Book a DemoInstallSign in
Socket

alternate-stylesheets

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alternate-stylesheets

switch alternate stylesheets

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

alternate-stylesheets.js

Actions Status: test npm version Try alternate-stylesheets on RunKit Renovate enabled

switch Alternate Style Sheets

Installation

npm

$ npm install alternate-stylesheets

yarn

$ yarn add alternate-stylesheets

Usage

ES Modules

import * as alternateStylesheets from 'alternate-stylesheets';

CommonJS

const alternateStylesheets = require('alternate-stylesheets');

browser

<script src="alternate-stylesheets.min.js"></script>

Example

// <link rel="stylesheet" title="cafe" href="cafe.css">
// <link rel="alternate stylesheet" title="orange" href="orange.css">
// <link rel="alternate stylesheet" title="chocolate" href="chocolate.css">

// get alternate stylesheets
const stylesheets = alternateStyleSheets.getAlternateStylesheets();

// enable orange stylesheet
alternateStyleSheets.setAlternateStylesheet('orange');

// enable chocolate stylesheet
alternateStyleSheets.setAlternateStylesheet('chocolate');

Functions

see documents

License

The MIT License.

FAQs

Package last updated on 20 Mar 2021

Did you know?

Socket

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