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

@devtools-ds/themes

v1.2.1

Published

Each of the UI components in this project contains themes for multiple browsers. These themes are built using the [postcss-themed](https://github.com/intuit/postcss-themed) package, which allows us to specify themes for multiple browsers in light and dark

Downloads

1,068,605

Readme

@devtools-ds/themes

Each of the UI components in this project contains themes for multiple browsers. These themes are built using the postcss-themed package, which allows us to specify themes for multiple browsers in light and dark mode.

This package contains colors, types, and React utilities for using browser themes.

Installation

npm i @devtools-ds/themes
# or with yarn
yarn add @devtools-ds/themes

Examples

ThemeProvider

You can use the ThemeProvider component to set the theme for all @devtools-ds components underneath it.

import { ThemeProvider } from "@devtools-ds/themes";

<ThemeProvider theme={"chrome"} colorScheme={"light"}>
  <YourApp />
</ThemeProvider>;

AutoThemeProvider

We also provide an AutoThemeProvider, which will automatically set the theme and color scheme of @devtools-ds components based on the users browser and preferred color scheme.

<AutoThemeProvider>
  <div id="my-app">
    <ObjectInspector />
  </div>
</AutoThemeProvider>

You can always override the AutoThemeProvider like a normal ThemeProvider.

<AutoThemeProvider theme="firefox">
  <div id="my-app">
    <ObjectInspector />
  </div>
</AutoThemeProvider>

You can also have the AutoThemeProvider automatically change the background color and text color to match the current browser and color scheme. In dark mode, this means the background color will be the browser's dark background and light text.

<AutoThemeProvider autoStyle>
  <div id="my-app">
    <ObjectInspector />
  </div>
</AutoThemeProvider>

useTheme

If you want to build your own component that leverages the ThemeProvider, we have a hook that allows you to get the current theme.

import { useTheme } from "@devtools-ds/themes";

const { currentTheme, currentColorScheme } = useTheme(
  { theme, colorScheme },
  styles
);

Variables

We have created a number of theme variables that have the common colors for different browsers. These are stored as JS objects. You can view the available variables in the Browser Themes story in Storybook.

import { chrome, firefox } from "@devtools-ds/themes";

chrome.light.gray01;
firefox.dark.blue02;