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

sassyicons

v0.1.0

Published

Flexible system to manipulate icons, SVG, PNG, sprites.

Downloads

11

Readme

SassyIcons

Flexible system to manipulate icons, SVG, PNG, sprites.

Works on top of compass sprite API.
It was designed to easily switch between SVG and PNG while working with icons as background-images.
So you have more granular control over which icons to use as SVG or PNG.
SVG first with PNG sprite fallback, or PNG first with hidpi sprite support.

Also managing several "thematic" sprites a breeze.

Best workflow used in conjunction with grunt-svg2png.

Online preview (test folder).
Online Documentation (generated with SassDoc).

Mixins

sprite-map-create($name [, $spacing])
icon($map, $sprite [, $offset, $format])
icon-single($map, $sprite [, $format])
icon-generated($map, $sprite [, $pos, $centered, $format])

Configuration

// Default settings.
$icons-defaults: (

  // Space around sprites in generated spritemap.
  // Useful with `$offset` parameter.
  // This setting is global for all spritemaps.
  // Can be set per spritemap with the `$spacing` parameter.
  spacing: 0,

  // Main icons directory. `sprite-map-create()`, base for sub dirs.
  dir: "icons",

  // Name of the png sub-folders.
  dir-png: "png",

  // Name of the hidpi png sub-folders.
  dir-hidpi: "png_2x",

  // Scale of the hidpi pngs.
  hidpi-scale: 2,

  // Minimum resolution ratio used in the hidpi media query.
  hidpi-ratio: 1.3,

  // Whether to embed icons as data URI in the `icon-single()` mixin.
  single-embed: true,

  // Default file format unless overridden by parameter, svg | png.
  format: "svg",

  // Whether to support legacy browsers, svg fallback.
  legacy: true

);

Override default values in a new $icons-settings map.

Requirements

  • Sass ~> 3.3.0
  • Compass ~> 1.0.0.rc.1

Install

Git

git clone [email protected]:pascalduez/SassyIcons.git

npm

npm install sassyicons --save

Bower

bower install SassyIcons --save

Compass extension

Since SassyIcons is dependant on Compass, this is the recommended installation and usage.

  1. Add gem 'SassyIcons', '~>0.1.0' to your Gemfile
  2. bundle install --path . (manage your gems in project dir, not globally)
  3. Add require 'SassyIcons' to your config.rb
  4. Import it in your stylesheets with @import 'SassyIcons'

Usage

Example usage with Compass

@import 'SassyIcons';
bundle exec compass watch

Roadmap

  • More documentation
  • icon-generated() and generated() Don't force absolute positioning.
  • Rewrite generated() mixin
  • icon-generated() configurable calc() fallback
  • Helper mixin to work with background-size
  • Support for SVG sprites ?
  • Support for SVG stacks ?
  • Try to further improve output CSS
  • More control over print position in the stylesheet ?
  • Abstract and move away from compass sprites ?
  • Move away from Modernizr classes ? Or make it an option.
  • Clarify or remove the @content thing to pass additional rules to .svg.

Development

You need

How to

  1. Fork this repository
  2. Run npm install
  3. Make your changes + write tests
  4. grunt test
  5. Commit + Pull request

Authors

Pascal Duez

Licence

SassyIcons is available under the MIT license.