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

tailwindcss-color-variables

v0.1.1

Published

A collection of color variables of Tailwind CSS.

Downloads

1

Readme

Tailwind CSS Color Variables

Overview

This project is a collection of color variables of Tailwind CSS, a utility-first CSS framework. Tailwind CSS provides an extensive set of predefined color classes, but it lacks the ability to easily access these colors in JavaScript or other CSS parts of the application. This repository aims to solve this problem by providing all the Tailwind CSS colors as CSS variables that can be used throughout your project.

How to Use

Installation

To use the Tailwind CSS color variables in your project, simply include the provided colors.css file in your HTML or import it in your CSS file.

Accessing Colors

All colors are defined as CSS variables in the :root selector, and they follow the naming convention --color-{colorName}-{shade}. For example, the variable for the red color with a shade of 500 would be --color-red-500. You can use these variables in your styles like this:

.element {
    background-color: var(--color-blue-300);
    color: var(--color-gray-800);
}

Using @import in CSS

To use Tailwind CSS Color Variables with @import, add the following line to your CSS file:

@import url("https://unpkg.com/[email protected]/colors-[rgb|rgba|hex|hsla].css");

Replace [rgb|rgba|hex|hsla] with the color format you prefer to use (rgb, rgba, hex, or hsla). For example, if you want to use the RGBA color format, your @import statement will be:

@import url("https://unpkg.com/[email protected]/colors-rgba.css");

Using <link> tag in HTML

To use Tailwind CSS Color Variables with the <link> tag in your HTML file, include the following line in the <head> section:

<link
    rel="stylesheet"
    href="https://unpkg.com/[email protected]/colors-[rgb|rgba|hex|hsla].css"
/>

Replace [rgb|rgba|hex|hsla] with the color format you prefer to use, just like in the @import example.

Now you can access all the color variables provided by Tailwind CSS Color Variables in your project without any package installations.

Please note that using UNPKG directly in production may not be recommended for larger projects due to potential performance and caching issues. It is better to consider package installations or other build tools for such scenarios.


Contributing

If you notice any issues with the color definitions or want to add more colors or shades, feel free to contribute to this project! Simply fork the repository, make your changes, and submit a pull request.

License

This project is open-source and available under the MIT License.

Disclaimer

This project is not an official part of Tailwind CSS and is maintained by the community. The colors used in this project are sourced from the Tailwind CSS documentation and are subject to change if the official Tailwind CSS project updates its color palette.