Skip to content

Instantly share code, notes, and snippets.

@bfillmer
Created June 16, 2014 15:45
Show Gist options
  • Save bfillmer/ece4e9dd7e942312847d to your computer and use it in GitHub Desktop.
Save bfillmer/ece4e9dd7e942312847d to your computer and use it in GitHub Desktop.
Generic LESS Mixins
// Liked what Chris Coyier showed off in this blog post:
// http://codepen.io/chriscoyier/blog/some-mini-sass-mixins-i-like
// Decided to make LESS versions really quickly.
.coverer() {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.centerer() {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.word-wrap() {
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
.ellipsis() {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.black(@opacity) {
@black: rgba(0, 0, 0, @opacity);
}
.white(@opacity) {
@white: rgba(255, 255, 255, @opacity);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment