Giter VIP home page Giter VIP logo

Comments (5)

aslansky avatar aslansky commented on August 20, 2024

If you use css as the output format css-sprite will generate the classes for you. When using a pre-pocessor like scss it just generates the needed mixins.

from css-sprite.

aslansky avatar aslansky commented on August 20, 2024

Or you could also create your own template for generating scss. Have a look at the templates that come with css-sprite in lib/templates.

from css-sprite.

bguiz avatar bguiz commented on August 20, 2024

Yup, I am aware of that.

The thing is that I am not sure why that should be the case. Generally I
want to have sprite classes generated for every single sprite that is
inside the output image.

It is quite a simple addition to the basic template too, like I have done
here:
https://github.com/bguiz/node-angularity/blob/feature/sprites/tasks/sprites.scss.mustache#L51-L53

I know I can always create a custom template, just think that this should
be the default behaviour.

W: http://bguiz.com

On 5 February 2015 at 20:23, Alexander Slansky [email protected]
wrote:

Or you could also create your own template for generating scss. Have a
look at the templates that come with css-sprite in lib/templates.


Reply to this email directly or view it on GitHub
#44 (comment).

from css-sprite.

aslansky avatar aslansky commented on August 20, 2024

Yeah ok. We have different opinions about that. I want to keep the generated styles as small as possible, but I can see why this would be helpful. I'll reopen the issue a a reminder for me. Right now I am just filled up with work stuff.

from css-sprite.

gargantuan avatar gargantuan commented on August 20, 2024

I just had to do something simmilar in a project I'm working on. I would suggest creating your own template and using something like this at the end of your template

{{#items}}
.icon-{{name}}
    @extend .icon
    sprite(${{name}})

{{/items}}

I agree with @aslansky that the generated styles should be as small as possible. I feel it should be left to individuals to create their own concrete-classes via the template mechanism.

EDIT: Sorry, I should have read the comments more closely - it appears you've already arrived at this solution.

from css-sprite.

Related Issues (20)

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.