littlebusters / Sketch-CSS-Sprite-Mixin

Generate a code of CSS Sprite Mixin to Clipboard in Sketch.
104 stars 16 forks source link

Less mixing not working correctly #5

Closed dottodot closed 8 years ago

dottodot commented 8 years ago

This is the less code that generated

.cssSprite( @spriteVals ) {
    width: extract( @spriteVals, 1 );
    height: extract( @spriteVals, 2 );
    background-repeat: no-repeat;
    background-image: e( %( 'url(%s)', extract( @spriteVals, 3 ) ) );
    background-position: extract( @spriteVals, 4 ) extract( @spriteVals, 5 );
    @media only screen and ( -webkit-min-device-pixel-ratio: 2 ), only screen and ( min-device-pixel-ratio: 2 ) {
        background-image: e( %( 'url(%s)', extract( @spriteVals, 6 ) ) );
        background-size: @bgiSizeW @bgiSizeH;
    }
}
@icon-spritePath: '../img/icon-sprite';
@icon-spriteURL: @icon-spritePath + '.png';
@icon-spritex2URL: @icon-spritePath + '@2.png';
@bgiSizeW: 470px;
@bgiSizeH: 409px;
@arrow-right-orange: 40px 40px @icon-spriteURL -120px 0px @icon-spritex2URL;

but when I do .cssSprite(@arrow-right-orange) it generates a background image of background-image: url([object Object],[object Object]);

but if I change the urls to

@icon-spriteURL:  '../img/icon-sprite.png';
@icon-spritex2URL: '../img/icon-sprite@2.png';

it works

littlebusters commented 8 years ago

Thanks for the report! Fixed a issue. 寿司ゆき:15