Giter Club home page Giter Club logo

Comments (3)

jakesgordon avatar jakesgordon commented on June 3, 2024

I don't think there is an image-url function built into SASS directly, so I'm guessing you are talking about the helpers added by sass-rails ?

As you rightly point out, the current version of sprite factory only allows customization of the text inside the css url() method. So instead of using the sass-rails image_url method, you would have to use the slightly lower level image_path, e.g.

:csspath => "image_path('$IMAGE')"

or

:csspath => lambda{ |i| "image_path('#{i}')" }

Which should work (in theory - haven't actually tried it myself)

Extending the sprite-factory to allow customization of the entire string (including the url() part) would be tricky to do without breaking backward compatibility. I should probably follow the same pattern as sass-rails and leave :csspath as the way to override just the path, and introduce a new, but similar :cssurl as a way to override the entire string....

.... I'll give that a little more thought and see what I can come up with. I'm reluctant to have 2 ways to do practically the same thing, but perhaps I'd just deprecate (and eventually remove) the :csspath mechanism.

from sprite-factory.

jakesgordon avatar jakesgordon commented on June 3, 2024

I decided to break backward compatibility (a tiny bit) and replaced the :csspath option with a new :cssurl option that allows you to control the entire value, including the outer url(...).

So, with the 1.5.2 branch you should now be able to specify:

:cssurl => "image-url('$IMAGE')"

See "Customizing the CSS Image Path" in the README for more details.

Hope that helps.

from sprite-factory.

GBH avatar GBH commented on June 3, 2024

Super awesome. Thanks!

from sprite-factory.

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.