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

postcss-sprite

v3.0.0

Published

postcss-plugin sprite

Downloads

4

Readme

postcss sprite 插件

简介

image

环境准备

nodejs >= 8.0.0

安装

$ yarn add postcss-sprite -D

使用

API

  • baseSize

  • input

    • 以该值为相对目录查找图片合并
    • 默认 "./"
  • output

    • 生成精灵图的路径
    • 默认 "./"
  • filename

    • 生成精灵图的名称
    • 默认 "sprite.png"
  • revision

    • 以 sprite 图片的 md5 生成版本号
    • 默认值 true
  • spritesmithOptions

  • filter

    • 默认值 (url) => true
    • 如果返回 false 当前图片 url 不进行 sprite 操作
  • publicPath: string: '' function

    • string 设置图片前缀
    • funciton
      publicPath = opts => {
        let { dirname, filename } = opts;
        return join(dirname, filename);
      };

更新记录

  • v3.0.0 (2019-08-28)

    • 删除 replaceUrl 添加 publicPath
    • source 改成 input
  • v2.2.1 (2017-06-22)

    • 添加正确的 package.json engines 选项
  • v2.2.0 (2017-06-20)

    • 参数 file -> filename
    • 修复没有图片合并时会生成一个空图片
  • v2.1.0 (2017-06-19)

    • 添加 revision 选项,默认支持以 sprite 图片的 md5 值做版本号
  • v2.0.0 (2017-06-19)

    • 完美支持开发环境与发布环境的 rem 支持
    • 需要 nodejs>=8.0.0 (用到了 promisify)
    • 不兼容 1.x.x 版本
    • 需要 background-image 来声明 不支持 background 简写
  • v1.5.0 (2017-06-15)

    • 自动删除开发环境设置的 width height background-size
  • v1.4.0 (2017-05-25)