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

@jarvisniu/unstyle

v0.1.0

Published

Write less styles

Downloads

4

Readme

unstyle

Write less styles

同类项目

设计决策

  • 要连字符:比如 p-l-5 不能 pl5,可读性差,且很容易冲突。
  • 不加字号:自己定义分级的,比如 1 ~ 6,可以参考 font-size.css 。不要用 px, rem 的,又多又杂不统一。
  • 不加弹性框:用的少,方案还没想好,而且有专门的解决方案 flex.css
  • 不引用源码定制:使用CSS变量达到既可以不引用源码,又可以定制样式的目的。目前仅支持配置边框颜色。

下个版本

考虑中

  • outline: ol- | o- (可能与 overflow 混淆,但值不混淆,可以共用),它也算盒模型。
    • overflow: hidden scroll auto overlay? visible
    • outline: { style }, { color }, { width }, { offset }!
    • opacity: 0-10
  • 垂直居中: align-center = [-webkit-]align-items: center;
  • 语义化边距尺寸: sm=5, md=10, lg=20, xl=40 或 s=5, m=10, l=20

文档

布局

  • 显示(display): block, inline, inline-block
  • 定位(position): absolute, relative, fixed, sticky
  • 浮动: float-left | right, clearfix
  • 全尺寸: full-size, full-height, full-width, w-full, h-full
  • 溢出: overflow(o-): visible scroll hidden auto

盒模型

  • 边距: margin(m-x-1), padding(p-x-1), x@a(all四周), tblr(上下左右), xy(轴的方向), m-x-a
  • 尺寸: width(w-), height(h-), minus height(h-m-), max-, min-, w-{ m }-{ n }
  • 全尺寸: full-size, full-height, full-width, w-full, h-full
  • 边框
    • 样式 b-{ none solid dotted dashed double hidden }
    • 圆角 b-r-{ length }
    • 圆形 b-circle
    • 粗细 b-thin(半像素), b-thick(2px)
  • 上下左右: top, bottom, left, right

文本

  • 行高: line-height(l-h-)
  • 对齐: text-align: left, right, center, justify
  • 样式: bold, italic, underline, line-through, text-ellipsis(...), break-word(word-break: break-all)
  • 对齐: vertical-align: top = v-a-top
  • 空白: nowrap, pre, pre-line, pre-wrap

杂项

  • 颜色: 文字 color-{ color }, 背景 bg-{ color }, 边框 b-{ color }, 灰阶 { x }-gray-[1-e]
  • 禁止: 换行 no-wrap (white-space: nowrap), 粗体 no-bold (font-weight: normal), 选择 no-select (user-select: none), 拖拽 no-drag (user-drag: none)
  • 光标: cursor(c-{ style }): default none pointer crosshair text move
  • 显隐: invisible (visibility: hidden), visible (visibility: visible)

FAQ

如何改变边框颜色?

覆盖下面的内部CSS变量即可。

注意:加在 :roothtml 上可能会由于导入顺序的原因而导致无法覆盖。

body {
  --unstyle-border-color: pink;
}