Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong dimensions and color #59

Closed
tanmay1978 opened this issue Sep 7, 2015 · 8 comments
Closed

wrong dimensions and color #59

tanmay1978 opened this issue Sep 7, 2015 · 8 comments
Assignees
Labels

Comments

@tanmay1978
Copy link

An icon of dimension 40x40 when added to sprite it renders it as 50x50

Another issue is with the color. If I have a svg icon of white when that is added to the sprite it defaults to black. But that is beacause a class is added to all the svg elements and that class is overriden for other icons in the sprite. Is that a way to eliminate the use of css styles that it applies by default?

@jkphl jkphl added the question label Sep 7, 2015
@jkphl jkphl self-assigned this Sep 7, 2015
@jkphl
Copy link
Collaborator

jkphl commented Sep 7, 2015

Hey @tanmay1978,

regarding the dimension issue, please post your complete configuration for the transformation.

Regarding the color: Please follow this thread for an explanation (and possible solution).

Cheers, Joschi

@tanmay1978
Copy link
Author

Hi the grunt config is as follow

// Make SVG sprite images from input svg icons
        svg_sprite : {
            your_target : {
                cwd         : paths.images.srcIcons,
                src         : '*.svg',
                dest        : paths.images.staticImages,
                options                 : {
                    shape               : {
                        spacing         : {
                            padding     : 5
                        }
                    },
                    mode                : {
                        view            : {
                            bust        : false,
                            render      : {
                                scss    : {
                                    dest    : '_sprite'
                                }
                            }
                        }
                    }
                }
            }
        },

@jkphl
Copy link
Collaborator

jkphl commented Sep 7, 2015

So the dimension increase from 40 to 50 pixels is a logical result of your shape.spacing.padding = 5 option, as shape.spacing.box defaults to "content". Please see the documentation for all details about this.

Did you follow the other thread regarding the CSS issue.

As I don't see any error in svg-sprite's behavior here I'll close this issue for now. Please feel free to re-open it in case of any further real errors.

Cheers, Joschi

@jkphl jkphl closed this as completed Sep 7, 2015
@tanmay1978
Copy link
Author

Thanks will check and confirm

@tanmay1978
Copy link
Author

I just checked if I use shape.spacing.box then the sprites are generated with no spacing between them and still the dimensions vary by 10px

@jkphl
Copy link
Collaborator

jkphl commented Sep 7, 2015

What value did you set for shape.spacing.box?

@tanmay1978
Copy link
Author

it was set to "content"

[image: --]

Tanmay Arun Navghare
[image: https://]about.me/tanmayarunnavghare
https://about.me/tanmayarunnavghare?promo=email_sig

On Tue, Sep 8, 2015 at 12:52 AM, Joschi Kuphal notifications@github.com
wrote:

What value did you set for shape.spacing.box?


Reply to this email directly or view it on GitHub
#59 (comment)
.

@jkphl
Copy link
Collaborator

jkphl commented Sep 8, 2015

So you didn't change anything? Then, of course, the behavior wouldn't change. Again, please read the relevant documentation section to understand the available options and how to use them. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants