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

@scalar/themes

v0.13.25

Published

the default CSS variables for all Scalar packages

Readme

Scalar Themes

Version Downloads License Discord

Scalar Themes provides a library of themes for all Scalar products and components. It also contains the base set of Scalar CSS variables and an associated Tailwind preset which leverages those variables.

To see a list of available themes, see the presets export.

CSS Layers

The themes package uses two CSS Layers to apply the theme styles

  • scalar-base: A copy of the core Scalar CSS variables and default theme
  • scalar-theme: Optionally overrides scalar-base with theme styles

Any styles added outside of these layers will override all the styles in the layers which allows you to extend or customize a theme.

Scoping

Because many Scalar applications are embedded into other websites the reset is scoped to the scalar-app class. This means you need to add this class to the root element of your application where you want the theme to apply. If you are using the themes in a standalone application, you can just add this class to the body element.

<body class="scalar-app">
  <!-- Your application content -->
</body>

Installation

pnpm i @scalar/themes

Usage via CSS Import (Basic)

To import the basic theme styles into your project, you can just import style.css which imports the reset, scrollbars, and a copy of the base Scalar CSS variables and default theme.

import '@scalar/themes/styles.css'

To add a theme, you can import the theme from the presets directory.

import '@scalar/themes/presets/alternate.css'

Usage via JavaScript

To use the themes package via JavaScript, you can use the getThemeStyles function from the package. The function will generate CSS style string which you can then add to the head of your document.

import { getThemeStyles } from '@scalar/themes'

const styles = getThemeStyles('alternate', { layer: 'scalar-theme' })
document.head.insertAdjacentHTML('beforeend', `<style>${styles}</style>`)

The function allows you to pass in a theme ID and an optional options object to configure the layer (default: scalar-theme) and whether to include the default fonts (default: true).

Usage via Tailwind

To use the themes package with Tailwind, you first need to import the base styles either via CSS or JavaScript (see above).

Then you can use the tailwind config in your Tailwind CSS to expose the theme colors and variables. The Scalar Tailwind config already contains a preflight and copy of the base Tailwind theme so all you need to import from Tailwind is tailwindcss/utilities.css.

@import "@scalar/themes/style.css"; /* Theme Base Styles and Reset */
@import "@scalar/themes/tailwind.css"; /* Tailwind Theme + Config */

@import "tailwindcss/utilities.css"; /* Generate the Tailwind classes */