Coder Social home page Coder Social logo

compass-spriter's Introduction

Compass Spriter

A responsive sprite sheet generator plugin for Compass.

There are many sprite generators out there, and even one built in to compass. However, none of these sprite sheet generators can be applied to responsively sized elements. If you have an element with a percentage width or height, you will need a percentage background-position, which this plugin provides.

##Installation

$ gem install compass-spriter

##Usage

When creating a new project for Compass

$ compass create <my_project> -r compass-spriter --using compass-spriter

If using an existing project, edit your config.rb and add this line:

require 'compass-spriter'

To use the responsive sprite mixin

@import "spriter";

div#menu-icon{
	@include spriter(menu-icon);
}

##Options

You can configure Spriter's settings (defaults shown below).

If you want to override these settings, you must set the variables before the first use of @include spriter();

//glob of images to use in the sprite sheet
$spriter-images: "sprites/*.png";

//number of pixels of space between sprites
$spriter-spacing: 2px;

##Browser support

Browser support is generally very good. Any browser that supports percentage-positioned background images should be fine.

##Contributions

Pull requests or the opening of issues are always welcome

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.