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

tailwindcss_cssvariable_fallback

v1.1.1

Published

provider css variable property fallback for tailwindcss v2 or v3

Readme

tailwindcss_cssvariable_fallback

tailwindcss中某些颜色属性添加降级选项。

安装

从npm上安装这个插件:

npm install -D tailwincss_cssvariable_fallback

然后添加这个插件到你的tailwind.config.js文件中

// tailwind.config.js
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require('tailwincss_cssvariable_fallback'),
    // ...
  ],
}

用法

前提目前不支持JIT模式下的降级。因此你要使用某些颜色属性,同时希望触发降级特性,请在tailwind.config.jstheme中的colors属性中为它指定一个唯一的颜色名。例如:

// tailwind.config.js

module.exports = {
  theme: {
    colors: {
      primary: '#04cb94',
    }
  }
}

现在如果你使用bg-primary为某个元素赋予背景颜色为primary会触发此插件,于是在生成的属性中你会看到

.bg-primary {
  background-color: '#04cb94'
}

注意目前仅支持bg-*, text-*, border-*等属性, 对于text-red-200/[0.2]带透明度的写法,在tailwindcss v3中存在兼容问题,v3中这种写法会生成rbg() with alpha的css属性。例如: text-red-200/20会生成color: rgb(254 202 202 / 0.2)。这种写法IE是不兼容的,请考虑添加postcss-color-rgb插件到你的postcss配置中

新特性

目前支持content指令,为伪元素添加content: " "属性。你可以在任何使用after或者before的场景下使用content。以获得兼容IE的写法。

<div class="after:conten">Demo</div>

将会生成

.after\:content::after {
  content:" ";
}