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

runa-theme

v1.0.8

Published

a theme for runa

Readme

theme import

  • esm
npm i runa-theme -S;

import { changeTheme } from 'runa-theme';
changeTheme(localStorage.getItem('theme'));
  • umd
<script src="http://unpkg.com/runa-theme/lib/index.umd.js"></script>
runaTheme.changeTheme(localStorage.getItem('theme'));

css vars

// 浅色模式配置
export const lightConfig = {
  '--c-brand': '#4194FC', // 主题色
  '--c-bg': '#EEF2F5', // 背景色
  '--c-bg-content': '#ffffff', // 内容背景色
  '--c-bg-sidebar': '#252d39', // 侧边栏背景
  '--c-bg-nav': '#252d39', // 导航栏背景
  '--c-bg-hover': '#d9eafe', // hover背景
  '--c-bg-stripe': '#f5f6f8', // 斑马行背景
  '--c-text-1': '#121933', // 主要文字
  '--c-text-2': '#304265', // 常规文字
  '--c-text-3': '#778299', // 次要文字
  '--c-text-4': '#8b98b2', // 占位文字
  '--c-border-1': '#dee0ea', // 一级边框
};
// 深色模式配置
export const darkConfig = {
  '--c-brand': '#4194FC', // 主题色
  '--c-bg': '#000000', // 背景色
  '--c-bg-content': '#0F1A38', // 内容背景色
  '--c-bg-sidebar': '#05315E', // 侧边栏背景
  '--c-bg-nav': '#0B2548', // 导航栏背景
  '--c-bg-hover': '#152652', // hover背景
  '--c-bg-stripe': '#1D2643', // 斑马行背景
  '--c-text-1': '#ffffff', // 主要文字
  '--c-text-2': '#ffffff', // 常规文字
  '--c-text-3': '#ffffff', // 次要文字
  '--c-text-4': '#ffffff', // 占位文字
  '--c-border-1': '#213B59', // 一级边框
};

navBar use

  • dom
<el-switch
    v-model="themeValue"
    active-value="dark"
    inactive-value="light"
    @change="handleChangeTheme">
</el-switch>
  • js
import { changeTheme } from 'runa-theme';

export default {
  data() {
    return {
      themeValue: localStorage.getItem('theme') || 'light'
    }
  },
  methods: {
    handleChangeTheme(value) {
      localStorage.setItem('theme', value);
      changeTheme(value);
    }
  }
}

组件使用css主题变量

  • 本着最小改动原则,每个项目需新建dark.scss文件(src/styles/dark.scss),用于写入黑色模式下的样式,完成样式覆盖,并在main.js引入
import '@/styles/dark.scss'
  • 在新页面的组件中完成主题适配,需使用css变量, 如
<style lang="scss" scoped>
    div {
        background: var(--c-bg-content);
        color: var(--c-text-1);
    }
</style>