Skip to content

Instantly share code, notes, and snippets.

@cbergau
Created May 18, 2014 18:20
Show Gist options
  • Save cbergau/af783a3fd73becff3d1b to your computer and use it in GitHub Desktop.
Save cbergau/af783a3fd73becff3d1b to your computer and use it in GitHub Desktop.
SASS Mixin Example
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
@mixin border-shadow($horizontal, $vertical, $blur, $spread, $color) {
-webkit-box-shadow: $horizontal $vertical $blur $spread $color;
box-shadow: $horizontal $vertical $blur $spread $color;
}
.message {
@include border-radius(4px);
@include border-shadow(0, 0, 1px, 1px, rgb(44, 44, 44));
}
.error_message {
@extends .message;
background-color: red;
p {
color: white;
}
}
.warning_message {
@extends .message;
background-color: yellow;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment