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

promet-icons

v0.0.3

Published

Icon automation workflow with Figma

Downloads

4

Readme

PROMET-ICONS

PROMET-ICONS

使用

基于 CSS 变量,组件具体可根据业务需要进行封装

<i
  class="promet-icon normal"
  style="--image: var(--add); --size: 40px; --color: #545454"
></i>
.promet-icon {
  width: var(--size);
  height: var(--size);
}

/* tint icon */
.promet-icon.normal {
  background-color: var(--color, #000);
  -webkit-mask-image: var(--image);
  -webkit-mask-position: center center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100%;
}

/* 多色 icon */
.promet-icon.ext {
  background: center / var(--size) no-repeat var(--image);
}

icon 是怎么生成的?

  1. 通过 fetch 先把 figma 的 icon components 抓取下来保存为 svg 或 png 等。
  2. 通过 convert 对 👆 抓取下来的 icon assets 进行转换(通常针对业务中对 icon 的使用方法来决定转换的格式)。
    1. 将 svg 的图片通过 SVGO 进行压缩处理,并以 Data URLs 的形式作为 CSS 变量保存在icons.css中。
    2. 将 png 的以 Base64 Data URLs 的形式作为 CSS 变量保存在icons.css中。
  3. 业务方可以通过 npm scripts 等方法对 npm 包进行更新,同时将 ./node_modules/PROMET-icons/dist 下的内容进行处理。如:
    DIR_PATH=./node_modules/PROMET-icons/dist
    cp ${DIR_PATH}/icons.css ./style/icons.css

生成文件

├── compressed
│   └── svg // 压缩后的 svg 文件
├── png // 从 figma 导出的 png 文件
└── svg // 从 figma 导出的 svg 文件
└── icons.css // icon CSS 变量
└── data.json // 所有 icon 名称的JSON

figma 配置 & 发布 & 更新

  1. 可参考 webnovel-iconsleadream/figma-icon-automation README 文档
  2. Github token:联系 Gwokhov 获取

Base on:

  1. primer/figma-action
  2. leadream/juuust-react-icon
  3. leadream/figma-icon-automation