jkphl / grunt-iconizr

SVG + PNG icon kit generator — Grunt plugin wrapping around node-iconizr that creates a CSS icon kit from a bunch of SVG files, serving them as SVG / PNG sprites or embedded data URIs along with suitable CSS / Sass / LESS / Stylus etc. stylesheet resources and a JavaScript loader for easy integration into your HTML documents
http://iconizr.com
MIT License
104 stars 9 forks source link

The SASS render option doesn't use the sprite #6

Closed nandastone closed 10 years ago

nandastone commented 10 years ago

When using the SASS renderer, the output .scss file doesn't actually use the spritesheet:

iconizr:
    dist:
        src: ['src/img/test/']
        dest: '<%= pkg.deployPath %>/img/svg/'
        options:
            level: 0
            verbose: 1
            prefix: 'icon'
            render:
                css: false
                scss: '_icons'

_icons-svg-sprite.scss:

.icon-arrow-black {
    background-position: 0 0;
    @extend %icon;
    # data URIs instead of spritesheet reference
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22h<etc>");
}

# etc

Is this intended?

jkphl commented 10 years ago

No Matt, it's not. Thanks for reporting this! I had no problems with this so far. Did you modify something about the Mustache templates?

Also, did you render the preview HTML documents (preview setting, I think)? What do these SASS stylesheets look like? Same problem? How big (file size) is your biggest SVG?

Thanks, cheers from the Tokyo subway, Joschi

nandastone commented 10 years ago
  1. No, I haven't modified the SASS template
  2. No, I wasn't rendering the preview HTML. I've enabled that option, with no difference to the output .scss file.
  3. The largest SVG is 4kb

Slightly unrelated question: is there a way to resize (scale) an icon via CSS? For example, a 24x24 icon should be scaled to 12x12 at a certain media-query breakpoint.

jkphl commented 10 years ago

2.) The HTML preview should render it's own set of stylesheets. Could you please take a look into those files and tell me the result? 4.) Just answered this very question on Twitter: https://twitter.com/IndooroopillySC/status/458791073385435136

jkphl commented 10 years ago

Oh, and by the way: Could you please provide your complete settings. I'm currently on my mobile phone only, but I'd try to check things out asap.

jepek commented 10 years ago

+1

andykenward commented 10 years ago

Yeah the sass output sprite files doesn't use the sprite file. It has the data in it.

jkphl commented 10 years ago

Should work now! :)