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

grunt-sprite

v0.0.5

Published

A grunt plugin to help front engineer creating css sprite.

Downloads

7

Readme

grunt-hellosprite

这是一个帮助前端开发工程师将css代码中的雪碧图的工具:

  1. 按最优算法将css文件中提到的雪碧图切片自动合并
  2. 在原css代码中为雪碧图切片添加background-position属性
  3. 如果原雪碧图切片a.png的同级存在[email protected]切片,则将[email protected]生成至用于高清设备的高清雪碧图,并在css文件末尾追加媒体查询代码

依赖

grunt-hellosprite 使用 spritesmith

使用之前

在使用之前需要你了解基本的gruntjs的基本安装和配置。

The "hellosprite" task

Overview

In your project's Gruntfile, add a section named hellosprite to the data object passed into grunt.initConfig().

grunt.initConfig({
  // Autosprite
    // 自动雪碧图
    hellosprite: {
    	sprite: {
            files: [
                {
                    expand: true, //启用动态扩展
                    cwd: 'tmp/css', // css文件源的文件夹
                    src: ['*.css'], // 匹配规则
                    dest: 'tmp/', //导出css和雪碧图的路径地址
                    ext: '.sprite.css' // 导出的css名
                }
            ],
            // options 
            option: {
                // OPTIONAL: Rendering engine: auto, canvas, gm
                'engine': 'gm',
                // OPTIONAL: Image placing algorithm: top-down, left-right, diagonal, alt-diagonal
                'algorithm': 'binary-tree'

            }
        }
    }
 })

Usage Examples

(Nothing yet)

Default Options

(Nothing yet)

Custom Options

(Nothing yet)

Contributing

(Nothing yet)

Release History

(Nothing yet)