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

unocss-preset-mp

v1.4.4

Published

👷

Downloads

20

Readme

unocss-preset-mp

👷

基于 @unocss/preset-mini 改写的,适用于小程序的预设,也可用于专门用于移动端的页面

  1. unocss-preset-weapp 不同,这个预设期望所有规则不会有微信小程序中不允许的特殊字符,这样我们就不需要去 transform 项目中的类名
  2. 这个预设尽量是作为 @unocss/preset-mini 的子集,尽量不做不兼容的更改,对于 alias,因为小程序体积限制较多,尽量只保留短的那一个

起步

import { defineConfig } from 'unocss'
import presetMp from 'unocss-preset-echo'

export default defineConfig({
  presets: [
    presetMp(),
  ],
  // 一定加上这个
  separators: ['-'],
})

移除

移除了如下的一些写法

透明度简写,c-black/100,可以用 c-black c-op-100 代替

# 开头的颜色写法:c-#fff (可以使用 c-hex-fff 代替)

一些比较常用的原子 CSS,只保留短名:(border|b)-xxx(opacity|op)-xxx(leading|ln)-xxx、font weight、(rounded|rd)-xxx 只保留 boplnfwrd 写法

尽量用 - 做一个分割,去掉了 w1h100 这样的写法

移除了 bracket 的写法,比如:c-[rgb(255,255,255)]w-[calc(100vh-8px)]

不兼容

所有使用分数的地方,如:

aspect-3/4 -> aspect-3to4

w-1/2 -> w-1to2

使用百分号的地方,如:

w-50% -> w-50pct

新增

safearea 相关:

h-screen-safe

p-[trbl]-safe-{size}

具体可以在 interactive docs 里看