at-import / jacket

Conditional Styles with Sass. Dress you CSS appropriately.
BSD 3-Clause "New" or "Revised" License
232 stars 9 forks source link

Output conditional style only into the conditional stylesheet #4

Closed polikin closed 11 years ago

polikin commented 11 years ago

It it possible to output only the conditional style in my conditional stylesheet? Because, I don't want to add weight to my conditional sheet. The only thing I want is the fix I did for IE.

Ex:

.exemple {
    width: 100px;
    height: 300px;

    @include jacket(ie8) {
        width: 200px;
    }
}

output css:

screen.css

.exemple {
    width: 100px;
    height: 300px;
}

ie8.css

.ie8 .exemple {
    width: 200px;
}

rather than

screen.css

.exemple {
    width: 100px;
    height: 300px;
}

ie8.css

.exemple {
    width: 100px;
    height: 300px;
}

.ie8 .exemple {
    width: 200px;
}
robwierzbowski commented 11 years ago

Unfortunately Sass doesn't work that way — I think it's mostly discussed in this issue: https://github.com/nex3/sass/issues/241

Currently conditional style mixins like Jacket and Breakpoint create complete stylesheets which you conditionally supply to your browsers. Give IE8 only the IE8 stylesheet (with conditional comments), and the same with the standards browsers.

polikin commented 11 years ago

Thanks!

robwierzbowski commented 11 years ago

No problem :smile: