Skip to content

Instantly share code, notes, and snippets.

@laurakalbag
Created December 18, 2012 17:33
Show Gist options
  • Save laurakalbag/4330047 to your computer and use it in GitHub Desktop.
Save laurakalbag/4330047 to your computer and use it in GitHub Desktop.
Example of rules based on design patterns in CSS made into nested Sass mixins and applied to HTML elements
// A few variables thrown in for good measure
$border-colour: #a4a4a4;
$unit: 10px;
@mixin subtle-shadow {
-webkit-box-shadow: 0px 2px 5px 0px rgba(200, 200, 200, 0.6);
box-shadow: 0px 2px 5px 0px rgba(200, 200, 200, 0.6);
}
@mixin shadow-border {
@include subtle-shadow;
border-bottom: $unit/10 solid $border-colour; /* Base unit divided by 10 = 1px */
padding-bottom: $unit*2; /* Base unit multipled by 2 = 20px */
margin-bottom: $unit*4; /* Base unit multipled by 4 = 40px */
}
article {
@include shadow-border;
}
header {
@include shadow-border;
}
p.intro {
@include shadow-border;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment