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

@vlalg-nimbus/nb-theme

v4.0.2

Published

Theme manager for Vuejs 3

Downloads

16

Readme

nb-theme

This plugin is only for Vue.js 3+

This lib contains theme Manager.

Installation

npm install @vlalg-nimbus/nb-theme

# or

yarn add @vlalg-nimbus/nb-theme

Usage

File main.js (Attention to the imported theme css file)

import { createApp } from 'vue'
import App from './App.vue'

import ThemePlugin from '@vlalg-nimbus/nb-theme'

import './style/style.css';
import "./style/themes.css"; // CSS file

const app = createApp(App)

app.use(ThemePlugin, {
  theme: 'dark',
  dev: true
})

app.mount('#app')

File theme.css

First of all, it is required to define :root with the names of the variables and their values.

For each theme that will be used, create a group in this css file defining the values of the variables. Pay attention to the names of the variables, if they do not exist in a theme, they will end up taking the value of :root.

Example:

:root {
  --bg-color: #ffffff;
  --text-color: #000000;
}

[data-theme='default'] {
  --bg-color: #04eeff;
  --text-color: #000000;
}

[data-theme='dark'] {
  --bg-color: #000000;
  --text-color: #ffffff;
}

[data-theme='other'] {
  --bg-color: tomato;
  --text-color: #ffffff;
}

If you do not follow the above pattern it will not work as expected.

Using with TypeScript

The lib provides automatic typing. Example:

// main.js
import { createApp } from 'vue'
import App from './App.vue'
import ThemePlugin from '@vlalg-nimbus/nb-theme'
import type { ThemeTextMap, ThemeOptions } from '@vlalg-nimbus/nb-theme'

const texts: ThemeTextMap = {
  light: {
    welcome: 'Bem-vindo',
    goodbye: 'Até logo'
  },
  dark: {
    welcome: 'Welcome',
    goodbye: 'See you'
  }
}
const themeOptions: ThemeOptions = {
  theme: 'dark',
  dev: true,
  texts
}
const app = createApp(App)
app.use(ThemePlugin, themeOptions)
app.mount('#app');


// Component
<script setup lang="ts">
  import { inject } from 'vue'
  import type { ThemePluginContext } from '@vlalg-nimbus/nb-theme'

  const theme = inject('$getTheme') as ThemePluginContext['theme']
  const changeTheme = inject('$changeTheme') as ThemePluginContext['changeTheme']
  const getThemeText = inject('$getThemeText') as ThemePluginContext['getThemeText']
  const getThemeVariableValue = inject('$getThemeVariableValue') as ThemePluginContext['getThemeVariableValue']
</script>

<template>
  <h1>{{ getThemeText('welcome') }}</h1>
  <p>{{ getThemeVariableValue('--bg-color') }}</p>

  <button @click="changeTheme('light')">Light mode</button>
  <button @click="changeTheme('dark')">Dark mode</button>
</template>


// composables/useTheme.ts
import { inject } from 'vue'
import type { ThemePluginContext } from '@vlalg-nimbus/nb-theme'

export const useTheme = (): ThemePluginContext => {
  const changeTheme = inject('$changeTheme') as ThemePluginContext['changeTheme']
  const getTheme = inject('$getTheme') as ThemePluginContext['theme']
  const getThemeText = inject('$getThemeText') as ThemePluginContext['getThemeText']
  const getThemeVariableValue = inject('$getThemeVariableValue') as ThemePluginContext['getThemeVariableValue']

  if (!theme || !changeTheme || !getThemeText || !getThemeVariableValue) {
    throw new Error('[nb-theme] Plugin not properly injected or used outside of Vue app context.')
  }

  return {
    changeTheme,
    getTheme,
    getThemeText,
    getThemeVariableValue
  }
}

// // Use composable
<script setup lang="ts">
  import { useTheme } from '@/composables/useTheme'

  const { getTheme, changeTheme, getThemeText, getThemeVariableValue } = useTheme()
</script>

<template>
  <h1>{{ getThemeText('welcome') }}</h1>
  <p>Background: {{ getThemeVariableValue('--bg-color') }}</p>

  <button @click="changeTheme('light')">Light mode</button>
  <button @click="changeTheme('dark')">Dark mode</button>
</template>

Plugin doc

Click the link below to find out how to use it, properties, events, etc:

  • nb-theme

License

MIT