
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
darkmode-vue
Advanced tools
A component darkmode injection in your document page with vue.js
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.
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
A component darkmode injection in your document page with vue.js
The npm package darkmode-vue receives a total of 1 weekly downloads. As such, darkmode-vue popularity was classified as not popular.
We found that darkmode-vue demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.