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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@refinist/tw4-config

v0.0.3

Published

Tailwind CSS v4 configuration, providing out-of-the-box mobile and modern web development solutions.

Downloads

53

Readme

🎨 @refinist/tw4-config

npm size

Tailwind CSS v4 配置,提供开箱即用的移动端和现代 Web 开发解决方案。

English Documentation | 中文文档

✨ 特性

🚫 1. 移除 Tailwind CSS Preflight

默认移除了 Tailwind 的 Preflight 样式重置,只引入了 theme.cssutilities.css,避免与现有项目样式冲突。

📱 2. 移动端安全区域支持

提供完整的 safe-area-inset-bottom 解决方案,兼容 Android 和 iOS 设备:

🔧 基础类:

  • saib-pb - 底部安全区域内边距
  • saib-mb - 底部安全区域外边距
  • saib-b - 底部安全区域定位距离

⚡ 动态类(支持任意值和裸值):

  • saib-pb-* - 底部内边距 + 安全区域,如saib-pb-2(padding-bottom: calc(var(--saib-spacing) * 2) /* 0.5rem = 8px */), saib-pb-[24px]
  • saib-mb-* - 底部外边距 + 安全区域,如saib-mb-2(margin-bottom: calc(var(--saib-spacing) * 2) /* 0.5rem = 8px */), saib-mb-[24px]
  • saib-b-* - 底部定位 + 安全区域,如saib-b-2(bottom: calc(var(--saib-spacing) * 2) /* 0.5rem = 8px */), saib-b-[24px]
<!-- 基础使用 -->
<div class="saib-pb-2">底部内边距 8px + 安全区域</div>
<div class="saib-mb-2">底部外边距 8px + 安全区域</div>
<div class="fixed saib-b-2">底部定位 8px + 安全区域</div>

🔄 3. 增强的 flex-1 类

改进了 flex-1 类的实现,解决了内部内容宽度/高度过宽导致容器被撑开的问题:

.flex-1 {
  flex: 1;
  min-width: 0; /* 防止水平方向内容撑开 */
}

.flex-col > .flex-1 {
  min-width: auto;
  min-height: 0; /* 防止垂直方向内容撑开 */
}

✂️ 4. 文本省略号工具类

提供开箱即用的单行文本省略功能:

<div class="text-overflow-ellipsis">
  这是一段很长的文本,超出部分会显示省略号...
</div>

💡 更多想法,正在路上...

📦 安装

# npm
npm install @refinist/tw4-config

# pnpm
pnpm install @refinist/tw4-config

# yarn
yarn add @refinist/tw4-config

# bun
bun add @refinist/tw4-config

🚀 使用

@import '@refinist/tw4-config';

考虑到很多 UI 框架都有自己的 reset 样式,所以没有引入 Preflight,如果你需要使用 Preflight,请自行引入 👇

@import '@refinist/tw4-config';
@import 'tailwindcss/preflight.css' layer(base);

🌍 兼容性说明

  • ✅ 安全区域功能兼容支持 constant()env() 的现代浏览器
  • 🤖 Android 设备无安全区域时会使用 0.1px 的默认值确保计算正确
  • 🔧 所有功能都基于现代 CSS 特性,建议在支持 CSS 自定义属性的浏览器中使用

📄 License

MIT

Copyright (c) 2025-present, Zhifeng (Jeff) Wang