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

radixui-colors-classless

v0.2.3

Published

Classless version of @radix-ui/colors

Downloads

17

Readme

radixui-colors-classless

npm

Modification of @radix-ui/colors that works without classes, adapted from https://github.com/radix-ui/colors/pull/27.

Installation

NPM

npm i radixui-colors-classless

PNPM

pnpm add radixui-colors-classless

Yarn

yarn add radixui-colors-classless

CDN (jsDelivr)

<head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate-alpha.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate-dark.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate-dark-alpha.css">
    ...
</head> 

Usage

Regular:

@import "radixui-colors-classless/slate.css";
@import "radixui-colors-classless/slate-alpha.css";
@import "radixui-colors-classless/slate-dark.css";
@import "radixui-colors-classless/slate-dark-alpha.css";

With url():

@import url("radixui-colors-classless/slate.css");
@import url("radixui-colors-classless/slate-alpha.css");
@import url("radixui-colors-classless/slate-dark.css");
@import url("radixui-colors-classless/slate-dark-alpha.css");

From jsDelivr CDN:

@import "https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate.css";
@import "https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate-alpha.css";
@import "https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate-dark.css";
@import "https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate-dark-alpha.css";

Or

@import url("https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate.css");
@import url("https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate-alpha.css");
@import url("https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate-dark.css");
@import url("https://cdn.jsdelivr.net/npm/radixui-colors-classless@latest/slate-dark-alpha.css");

The variables are named in the following format:

--slate-1, --slate-2, ..., --slate-12
--slate-a1,--slate-a2, ..., --slate-a12

Example usage:

.button {
    background-color: var(--cyan-9);
    color: var(--slate-1);
}
.button:hover {
    background-color: var(--cyan-10);
}

See https://www.radix-ui.com/colors for documentation of the colors themselves.

By default, these color schemes respect prefers-color-scheme for dark theme. If you only import non-dark-theme files, their colors will be used. If you import only dark theme files but your prefers-color-scheme is light, no colors will be usable.

Forcing a color scheme:

<div data-theme="light">...</div>
<div data-theme="dark">...</div>

You can check the format of the CSS files used at https://www.npmjs.com/package/radixui-colors-classless?activeTab=code

Editor Integration

VSCode

Enable autocompletion for the CSS variables in VSCode by installing the CSS Var Complete extension and adding the following in a .vscode/settings.json file in the root of your project.

{
    "cssvar.files": [
        "node_modules/radixui-colors-classless/*.css"
    ],
    // Do not ignore css files in node_modules, which is ignored by default
    "cssvar.ignore": [],
}

Autocompletion for CSS file paths are blocked by vscode#869. In the meantime, it's possible to do:

@import "/node_modules/radixui-colors-classless/slate.css";
@import "/node_modules/radixui-colors-classless/slate-alpha.css";
@import "/node_modules/radixui-colors-classless/slate-dark.css";
@import "/node_modules/radixui-colors-classless/slate-dark-alpha.css";

Or

@import url("/node_modules/radixui-colors-classless/slate.css");
@import url("/node_modules/radixui-colors-classless/slate-alpha.css");
@import url("/node_modules/radixui-colors-classless/slate-dark.css");
@import url("/node_modules/radixui-colors-classless/slate-dark-alpha.css");