Code Monkey home page Code Monkey logo

sprity-less's Introduction

sprity-less

NPM version Build Status Dependencies

A less style processor for sprity

Requirements

Install

Install with npm

npm install sprity sprity-less --save

If you want to use sprity-less with the command line interface of sprity install it globally.

npm install sprity sprity-less -g

Usage

On commandline:

sprity out/ src/*.png -s style.less -p less

In JavaScript:

var sprite = require('sprity');
sprite.create({
  ...
  style: 'style.less',
  processor: 'less'
  ...
}, function () {
  console.log('done');
});

less usage example

@import 'sprite'; // the generated style file (sprite.less)

// camera icon (camera.png in src directory)
.icon-camera {
  .sprite(@camera);
}

// cart icon (cart.png in src directory)
.icon-cart {
  .sprite(@cart);
}

More

See sprity documentation


Gitter

sprity-less's People

Contributors

aslansky avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sprity-less's Issues

How to control naming conventions

Hi guys,

I've recently updated from 1.0.2 to 1.0.3 and found out that my sprites' names are being prefixed with the name of the folder of the images.

Ex: in version 1.0.3, an image logo.png which is under the folder /project/img/icon/generic/ will have the variable name @generic-logo in less, whereas in version 1.0.2 it would be simply @logo.
This obviously breaks all the places where @logo is used because of the variable name change.

Is this a breaking change or is there a way of not prefixing the variables?

Thank you.

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.