svg-sprite / gulp-svg-sprite

SVG sprites & stacks galore — Gulp plugin wrapping around svg-sprite that reads in a bunch of SVG files, optimizes them and creates SVG sprites and CSS resources in various flavours
MIT License
648 stars 43 forks source link

Problem with the common property inside the configuration #73

Closed andreecordova closed 6 years ago

andreecordova commented 6 years ago

Hello, I was triying to create a configuration that have a custom common placeholder for my generated scss file, but when I saw my generated files. I notice that the placeholder is not extended in any icon class I had. My configuration is this:

config = {
    mode: {
      css: {
        dest: "css",
        common: "svg-general",
        bust: false,
        sprite: "sprites/general.svg",
        render: {
          scss: {
            dest: "./sprites/_sprite.scss"
          }
        }
      }
    }
  }

If I don't use the common property, It would generate for default %svg-common and in that case I saw that that placeholder is extended in any icon class. Why happened that or How can I fixed that?

jkphl commented 6 years ago

@andreecordova I'm afraid but I think I don't really understand your problem / question. Could you please add some CSS / SCSS code samples with the expected and the real results? Thanks!

andreecordova commented 6 years ago

Hi, @jkphl . Sorry if I didn't express myself very well.

The real result of using the common property in my config: real_result

The result I want to have: expect_result

jkphl commented 6 years ago

@andreecordova First of all: sorry for the late reply.

I think what you're after is the mode.<mode>.mixin property, not the mode.<mode>.common (which is creating a common CSS class rule, see documentation).