Philip Bulley
Philip Bulley

Reputation: 9434

Get reference to Compass sprite map when using @import

If I use the following to generate a sprite map:

@import "ui-icons/*.png";

How can I get a reference to the sprite map that has been created. I want to pass it to the sprite-position($map) function.

Upvotes: 2

Views: 239

Answers (1)

Morgan Delaney
Morgan Delaney

Reputation: 2439

Say you import via @import "icons/*.png", the variable $icons-sprites now contains the reference to the sprite-map function used by Compass' @import function.

The key is using $<folder>-sprites to reference that sprite map.

Upvotes: 7

Related Questions