Skip to content

Css rule optimization #103

Closed
Closed
@klierik

Description

@klierik

Hello there.

Thanks you for your module. It very good alternative grunt-compile module.

But a have some problem with CSS optimisation.

By default module generate CSS like:

.icons-add-group-24:before {
    width: 24px;
    height: 24px;
    line-height: 24px;
    background-image: url(../../images/icons.png);
    background-position: -40px -96px
    }

.icons-add-group-24_white:before {
    width: 24px;
    height: 24px;
    line-height: 24px;
    background-image: url(../../images/icons.png);
    background-position: -108px -96px
    }

.icons-bookbark_small_blue:before {
    width: 16px;
    height: 16px;
    line-height: 16px;
    background-image: url(../../images/icons.png);
    background-position: -150px -102px
    }

and my mustache file is

[class^="icons-"]:before,
[class*=" icons-"]:before {
    display: inline-block;
    margin-top: -1px;
    *margin-right: .3em;

    content: '';
    line-height: 16px;
    vertical-align: middle;

    background-repeat: no-repeat;
}

{{#items}}
.icons-{{name}}:before {
    width: {{px.width}};
    height: {{px.height}};

    line-height: {{px.height}};

    background-image: url({{{image}}});
    background-position: {{px.offset_x}} {{px.offset_y}};
}
{{/items}}

So, i don't need for each icon entry background-image: url(../../images/icons.png);
I want set background-image: url(../../images/icons.png); only one time for [class^="icons-"]:before, [class*=" icons-"]:before only and make css file more clearly.

Is it possible todo that?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions