Skip to content

Instantly share code, notes, and snippets.

@dmjcomdem
Created April 26, 2017 05:41
Show Gist options
  • Save dmjcomdem/8240e0cfc633a5c96d45b7c4999d6dff to your computer and use it in GitHub Desktop.
Save dmjcomdem/8240e0cfc633a5c96d45b7c4999d6dff to your computer and use it in GitHub Desktop.
Mixin extends
@mobile: ~'@media (max-width: 400px) ';
@tablet: ~'@media (max-width: 800px) ';
.bp(@rules) {
@media @mobile {
& .mobile { @rules(); }
}
}
.bp2(@point,@rules) {
& when( @point = tablet) {
@media @tablet { @rules(); }
}
}
body {
.bp({width: 50%;});
.bp2(tablet, {width: 100%;});
}
// body {
// .bp({width: 50%;});
// .bp2(tablet, {width: 100%;});
// }
// @media @media (max-width: 400px) {
// body .mobile {
// width: 50%;
// }
// }
// @media @media (max-width: 800px) {
// body {
// width: 100%;
// }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment