filamentgroup / grunticon

A mystical CSS icon solution.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

data-grunticon-embed doesn't resize the svg

anartfulscience opened this issue · comments

Hello,

I'm using data-grunticon-embed to colour the svg, but when you add data-grunticon-embed it ignores the resizing capabilities such as background-size: contain;

Is there a work around?

Thanks, Stephen

To resize an embedded SVG that is not a background anymore you will need to change the width and height of the SVG itself.

In a preprocessor that would look like this:

.icon {
    &.icon-size-sm {
        background-size: 16px 16px;
        width: 16px;
        height: 16px;

        svg {
            width: 16px;
            height: 16px;
        }
    }

    &.icon-size-lg {
        background-size: 64px 64px;
        width: 64px;
        height: 64px;

        svg {
            width: 64px;
            height: 64px;
        }
    }
}