Skip to content

Instantly share code, notes, and snippets.

@jamiehs
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiehs/9678998 to your computer and use it in GitHub Desktop.
Save jamiehs/9678998 to your computer and use it in GitHub Desktop.
Magical mixins with trees
@mixin gallery-items($size) {
.item {
float: left;
.thumbnail {
margin-bottom: $size/4;
text-align: center;
width: $size;
height: $size;
.vertical-helper {
display: inline-block;
height: 100%;
vertical-align: middle;
width: 1px;
}
}
}
}
#some-page {
.gallery {
@include gallery-items(200px);
}
}
#some-other-page {
#other-element {
.another-gallery {
@include gallery-items(400px);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment