I work on a SASS/COMPASS "framework" of my own (kind of).
I set a variable - $sprite - which is the name of the folder where all of the images are stored.
I do it this way so later I can use that name for replace-with-image-mixin and sprite generation.
Everything would be great if @import "#{$sprite}/*.png" was working.
Any ideas?
//sprite images folder name
$sprite: "sprite";
//settings
$sprite-sprite-base-class: ".#{$sprite}" - *works*;
$sprite-spacing: 20px;
$sprite-sprite-dimensions: true;
//generate sprite
@import "sprite/*.png"; - normal path - *works*
@import "#{$sprite}/*.png" - path with a variable in it - *doesn't work*
//mixin
@mixin replace-with-image($imageName){
@include replace-text-with-dimensions("#{$sprite}/#{$imageName}.png");
@extend %dis-ib;
} - *works*
I'm afraid this is simply not possible at the moment (and will never be as it looks from the issue that steveax posted). If you really want this, you'll have to write your own little preprocessor that resolves your variable, then outputs it to a .sass/.scss file. Alternitavely, submit a feature request...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With