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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@spark-web/theme

v5.10.6

Published

--- title: Theme isExperimentalPackage: true ---

Downloads

6,430

Readme


title: Theme isExperimentalPackage: true

🚧 — Under construction

The theme packages exports a set of objects and utilities that are used internally to create Spark Web components as well as for consumers to be able to override

useGlobalTheme

The useGlobalTheme hook returns the name of the theme set in the GlobalThemeProvider. It defaults to brighte if there's no value provided.

useTheme

The useTheme hook returns an object with our theme tokens along with a set of styling utilities.

The theme will always be in the same shape, but the values can be overridden by passing in a custom theme to the SparkProvider.

Theme tokens differ slightly from the values passed into the provider (or the defaultTokens if you don't provide a theme) as they are run through the decorateTokens function which add some extra values that should never change (and therefore aren't themeable) as well as using Capsize to add tokens we need to trim space above capital letters and below the baseline so spacing between elements is consistent and doesn't vary depending on line-height, font-size etc.

For more documentation about our tokens, please see the tokens reference page.

mapResponsiveProp

Returns either the string value of the token provided to it, or an array which maps to our breakpoints (where index 0 refers to the mobile breakpoint, 1 is the tablet breakpoint and so on).

Theme utils

mapResponsiveScale

Helper for mapping keys/breakpoint map to a theme scale e.g.

mapResponsiveProp('small', { small: 8, large: 16 }); // 8
mapResponsiveProp(
  { mobile: 'small', tablet: 'large' },
  { small: 8, medium: 12, large: 16 }
); // [8, 16]

optimizeResponsiveArray

TODO

responsiveRange

Designed to be used alongside optimizeResponsiveArray.

responsiveStyles

TODO

resolveResponsiveProps

TODO

defaultTokens

This is the default tokens for the Brighte theme before they've been decorated.

makeSparkTheme

This function

  • decorates to passed in tokens
  • decorates them
  • works out if the background tokens are dark or light
  • adds the theme utils

Pass the result of this function into the SparkProvider if you want to override the default theme.