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

ui-css-helper

v1.0.0

Published

## 快速开始

Readme

使用手册

快速开始

安装环境

  • 安装nodejs

  • 进入项目目录命令模式,执行以下命令

npm install

简易的命令使用

  • 进入项目目录命令模式,执行以下命令开始编译(只编译当前一次)
npm run start
  • 如果要监听文件实时编译,请执行以下命令动态编译(自动监听src下文件,实时生效)
npm run watch

编写的文件目录

把需要编译的文件放在src目录即可

生成的文件目录

文件经过postcss处理之后会在dist目录生成同名文件,这个就是被处理之后的文件

技能手册

一、自动转换px为rem,字体根据dpr转换(使用750设计稿)

注意:设置字体的时候,必须在后面加/*px*/,要不然会被转换成rem,如果遇到强制使用px的情况,可以在后面/*no*/

编译前:

.test-size{
  /*默认使用rem模式*/
  width:20px;
  /*使用dpr模式*/
  font-size: 15px;/*px*/
  /*强制使用px*/
  height:20px;/*no*/
}

编译后:

.test-size {
  width: 0.266667rem;
  height: 20px;
}

[data-dpr="1"] .test-size {
  font-size: 7.5px;
}

[data-dpr="2"] .test-size {
  font-size: 15px;
}

[data-dpr="3"] .test-size {
  font-size: 22.5px;
}

二、自动加前缀

编译前:

.test-prefix{
  display:flex;
  box-shadow: 2px 2px 2px #e2e2e2;
}

编译后:

.test-prefix {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-shadow: 0.026667rem 0.026667rem 0.026667rem #e2e2e2;
          box-shadow: 0.026667rem 0.026667rem 0.026667rem #e2e2e2;
}

三、颜色可以使用16进制

编译前:

.test-color{
  color:rgba(#f1f1f1,0.5);
}

编译后:

.test-color {
  color: rgba(241,241,241,0.5);
}

四、使用变量

打开variable.js文件,新增变量

module.exports = {
    primary: 'red',
    padding: '15px'
}

样式里面可以使用这里面的变量

编译前

.test-variable{
  color:$primary;
  padding:$padding;
}

编译后

.test-variable {
  color: red;
  padding: 0.2rem;
}