Skip to content

Instantly share code, notes, and snippets.

@niktariy
Last active July 10, 2019 12:02
Show Gist options
  • Save niktariy/d4322fdecb343796ff0bce52b75caf51 to your computer and use it in GitHub Desktop.
Save niktariy/d4322fdecb343796ff0bce52b75caf51 to your computer and use it in GitHub Desktop.
Mixins in different CSS-preprocessors
.round-borders(@radius) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
.button {
background-color: #adc;
.round-borders(15px);
}
=round-borders($radius)
-webkit-border-radius: $radius
-moz-border-radius: $radius
border-radius: $radius
.button
background-color: #adc
+round-borders(15px)
@mixin round-borders($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
border-radius: $radius;
}
.button {
background-color: #adc;
@include round-borders(15px);
}
round-borders() {
-webkit-border-radius: arguments;
-moz-border-radius arguments;
border-radius arguments
}
.button
background-color: #adc;
round-borders(15px)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment