Skip to content

Instantly share code, notes, and snippets.

@d13 d13/mq.less
Last active Oct 15, 2015

Embed
What would you like to do?
retina media-query
.m-mq(@query, @ruleset) {
@media @query {
@ruleset();
}
};
.m-mq-retina(@ruleset) {
@query: ~"only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min-device-pixel-ratio: 1.5), only screen and (min-resolution: 192dpi)";
.m-mq(@query, @ruleset);
};
.icon-foo {
width: 30px;
height: 30px;
background: url(../images/icon-foo.png) no-repeat center center;
.m-mq-retina({
background-image: url(../images/icon-foo-@2.png);
background-size: 30px 30px;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.