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 🙏

© 2024 – Pkg Stats / Ryan Hefner

nuxt-untheme

v0.0.4

Published

🔮 Build your own tokenized design system w/ dynamic CSS vars in Nuxt using Untheme.

Downloads

530

Readme

nuxt-untheme

🔮 Build your own tokenized design system w/ dynamic CSS vars in Nuxt using Untheme.

✨  Release Notes

Configuration

  1. Install the module
pnpm add nuxt-untheme untheme
  1. Create a config
// ~/untheme.config.ts
import { defineUnthemeConfig } from "untheme";

export default defineUnthemeConfig({
  tokens: {
    blue: "#0096ff",
    green: "#00a36c",
    orange: "#ff5733",
  },
  themes: {
    theme1: {
      primary: "blue",
      secondary: "orange",
    },
    theme2: {
      primary: "green",
      secondary: "blue",
    },
  },
  modes: {
    light: {
      active: "primary",
    },
    dark: {
      active: "secondary",
    },
  },
  roles: {},
});
  1. Activate the module
// ~/nuxt.config.ts
import untheme from "./untheme.config";

export default defineNuxtConfig({
  modules: ["nuxt-untheme"],
  untheme,
});
  1. Look to the future, your tokens are done!

Features

The nuxt-untheme module installs untheme and implements your token configuration as a reactive design system that:

  • Provides configurable themes & color modes
  • Publishes tokens as CSS variables
  • Exposes utility functions/types to extend the design system

Untheme

For more information about untheme and tokenized design systems, check out the untheme documentation.

For more information about design systems in general, check out the Material 3 documentation that inspired the untheme project.

CSS Variables

The token configuration is passed to a Nuxt plugin that uses unhead to declare CSS variables that mirror the token configuration. If using the configuration from above, you would also have access to two themes (theme1 & theme2) and two colors modes (light & dark).

Reference tokens have static values, so the var(--blue) token would always resolve to #0096ff.

If the active theme was set to theme2, the var(--primary) system token would resolve to #00a36c and the var(--secondary) system token would resolve to #0096ff.

If the active color mode was set to dark (with an active theme of theme2), the var(--active) system token would resolve to #0096ff.

Role tokens can be set to any of the above token values and will resolve according to the actively set theme & mode.

Utilities

| Function | Description | | ------------------ | --------------------------------------------------------------------------------------- | | useThemes() | Retrieve a literally-typed list of the available theme keys. | | useTheme() | Access the reactive state of the currently active theme. | | useMode() | Access the reactive state of the currently active mode. | | useUntheme() | Access the currently active untheme service w/ mode, theme, & tokens properties | | useUnthemeRoot() | Build a reactive CSS declaration string to manage CSS variable values |

License

MIT License © 2024-PRESENT Alexander Thorwaldson