Skip to content

Instantly share code, notes, and snippets.

@ziogaschr
Created June 13, 2014 16:26
Show Gist options
  • Save ziogaschr/44f4a0aa66322322e445 to your computer and use it in GitHub Desktop.
Save ziogaschr/44f4a0aa66322322e445 to your computer and use it in GitHub Desktop.
SASS: basic mixins
// by Chris Coyier, Some Mini Sass Mixins I Like
// http://codepen.io/chriscoyier/blog/some-mini-sass-mixins-i-like
@mixin centerer {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@mixin word-wrap() {
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@mixin ellipsis() {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
@function black($opacity) {
@return rgba(black, $opacity)
}
@function white($opacity) {
@return rgba(white, $opacity)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment