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

omegui-theme-generator

v0.1.3

Published

## Description

Downloads

6

Readme

Omegui theme generator

Description

Omegui is a set of tools to make Tamagui easier to set up and customize.

This is the theme generator, which allows you to create a theme for Tamagui from a minimal set of colors. You can also use preset themes to get started quickly.

Usage

Setup

First, install the package:

npm install omegui-theme-generator

Then, in your tamagui.config.ts, set your themes to the output of omeguiThemeGenerator, or add it to the other themes of your config like so:

import { config as configBase } from "@tamagui/config/v3";
import { createTamagui } from "tamagui";
import { omeguiThemeGenerator } from "omegui-theme-generator";

export const config = createTamagui({
  ...configBase,
  themes: {
    ...configBase.themes,
    ...omeguiThemeGenerator({
      light: "nord",
      dark: "dracula",
    }),
  },
});

The theme generator takes a light and a dark theme as arguments, which can be either the name of a preset theme or an object with the colors of your custom theme.

You can then access the colors of your theme in your Tamagui components with those color keys:

  • $primary
  • $primaryContent
  • $secondary
  • $secondaryContent
  • $accent
  • $accentContent
  • $neutral
  • $neutralContent
  • $success
  • $successContent
  • $warning
  • $warningContent
  • $error
  • $errorContent
  • $info
  • $infoContent

As well as the following keys for stronger shades:

  • $background2
  • $background3
  • $primary2
  • $secondary2
  • $accent2
  • $neutral2
  • $success2
  • $warning2
  • $error2
  • $info2

Preset themes

The following preset themes are available (more themes coming soon):

  • emerald
  • retro
  • nord
  • dracula
  • cyberpunk
  • pastel
  • autumn

Custom themes

You can also create your own custom theme by passing an object with the colors of your theme to the theme generator. Most color formats are supported, including hex, rgb, hsl, and oklch.

Your custom theme can be as short as this:

{
  primary: "#ff0000",
  secondary: "oklch(83.33% 0.184 204.72)",
  accent: "rgb(0, 255, 0)",
  neutral: "#ffffff",
}

For reference of what you can set in your theme, here is the full type definition:

type InputTheme = {
  primary: string;
  primaryContent?: string;
  secondary: string;
  secondaryContent?: string;
  accent: string;
  accentContent?: string;
  neutral: string;
  neutralContent?: string;
  background?: string;
  background2?: string;
  background3?: string;
  foreground?: string;
  info?: string;
  infoContent?: string;
  success?: string;
  successContent?: string;
  warning?: string;
  warningContent?: string;
  error?: string;
  errorContent?: string;
};

Upcoming

  • Wrapper for Tamagui components to add color variants (e.g. primary, secondary, etc.)
  • Support for theming border radius, shadows, animations and other properties (aiming for parity with daisyUI themes)
  • A visual theme editor to preview Tamagui components with your theme
  • Better documentation
  • Bundle size optimizations

License

MIT