Socket
Book a DemoInstallSign in
Socket

darkmode-vue

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

darkmode-vue

A component darkmode injection in your document page with vue.js

Source
npmnpm
Version
0.2.6
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

darkmode-vue

A component darkmode injection in your document page with vue.js

Live Preview

A component darkmode screenshot using in a application real

Install

npm install --save darkmode-vue

Usage basic

import DarkModeVue from 'darkmode-vue';

<DarkModeVue />

Prop hiddenLabel

<DarkModeVue :hiddenLabel="true" />

Prop hiddenIcon

<DarkModeVue :hiddenIcon="true" />

Style modification and usage in your styles

body {
  --dm-color-primary: #41b883;
  --dm-color-secondary: #34495e;
}

body.lightmode {
  --dm-color-text: #222;
  --dm-color-background: #fff;
}

body.darkmode {
  --dm-color-text: #fff;
  --dm-color-background: #222;
}

body.lightmode .teste {
  background: #f00;
}

Create your variable colors and update this with class .lightmode or .darkmode.

Description class of components

If DarkModeVue usage in a page, a class in body document is update with class darkmode or lightmode. In LocalStorage is created a key store with value current mode. Do you usage children body.darkmode or body.lightmode styles for your application. I recomend create a variables colors in css and update this with toggle class of body document.

FAQs

Package last updated on 28 Apr 2023

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