npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-apply-darkmode

v1.0.2

Published

Drop-in dark mode for VueJS projects.

Readme

vue-apply-darkmode

Drop-in dark mode for Vue 3.x apps. Apply dark mode directly to your site or app in one step; no manual theming required! Cut down on component complexity and CSS while still delivering a high-quality dark mode experience that your users will greatly appreciate.

vue-apply-darkmode is an adaptation of react-apply-darkmode, which is itself wrapper around @darkreader/darkreader's ES6 API—this allows allow you to control the package's dark mode functionality with Vue bindings.

Users do NOT need to have the Dark Reader extension installed for dark mode to work.

Installation

npm i vue-apply-darkmode

yarn add vue-apply-darkmode

Import

Vue 3.x

import interpolator from "vue-apply-darkmode";

Vue 2.x (your NuxtJS version may apply)

import interpolator from "vue-apply-darkmode/src/vue-apply-darkmode.vue";

Usage

Wrap your root component once with <interpolator>:

const app = Vue.createApp({});

app.component("my-app", {
  template: `<interpolator :dark="true" :watch-system="false">{{ title }}</interpolator>`,
});

Using NuxtJS?

If you're using NuxtJS (like I am), you should wrap each of your layouts with <interpolator> instead.

Not making use of layouts? Create and wrap the default layout, which is applied to every page that you don't assign a layout to.

layouts/default.vue
<template>
  <interpolator :dark="true" :watch-system="false">
    <Nuxt />
  </interpolator>
</template>

Props

| Prop | Values | Purpose | | ------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | dark | true or false | Manually turns dark mode on or off. This will always override whatever watchSystem determines. | | watch-system | true or false | Apply dark mode based on the device's color scheme. watch-system defaults to false. Not all browsers are supported; see Notes for more. | | brightness | 0 — 100 | Dark mode brightness, default 100. | | contrast | 0 — 100 | Dark mode contrast, default 90. | | brightness | 0 — 100 | Dark mode sepia (brownishness, if you will), default 10. |

Important: all props must be bound using v-bind.

Interpolator will reassess whether it should enable or disable dark mode if any one of these props changes.

Notes

  • watchSystem relies on the prefers-color-scheme CSS media feature, which some browsers may not support; privacy settings can also influence the value of prefers-color-scheme.

    Mozilla has compiled a list of compatible browsers here.

Tips

Persistence

You will need to implement your own wrapper component or container to persist dark mode across browser sessions by changing values supplied to the appearance prop. localStorage and redux (with redux-persist) are both good solutions.

Colors

vue-apply-darkmode will tone down bright colors and reduce contrast. Don't assume that a color is going to work optimally in light and dark mode; always do a visual test by switching between both modes!

Images

Maximize transparency of image assets! vue-apply-darkmode will not invert images (to preserve your sanity), so make sure your images have transparent backgrounds and transparency where color isn't needed.

Also, try to use colors that have good contrast in both light and dark mode.

Theming Conflicts

Don't use another dark mode theming solution alongside vue-apply-darkmode (i.e. with React context/providers, CSS classes, or another package). This can cause undesirable flickering effects when solutions try to compensate for each other's changes.

Component Library Issues

Certain UI component libraries don't work well with vue-apply-darkmode. Audit a library before choosing it! Installing the Dark Reader browser extension (Chrome or Firefox, for best results) and exploring a component library's site will give you a good idea of how well it works.

Credits

This package was created by Victor Li, an avid user of the Dark Reader extension.

vue-apply-darkmode is made possible by the open source @darkreader project. If you like this package, please give a shoutout to Dark Reader's developers and consider sponsoring their project!