Skip to content

Instantly share code, notes, and snippets.

View imlinus's full-sized avatar

Linus imlinus

  • bitwise
  • Sweden
  • 10:43 (UTC +02:00)
View GitHub Profile
@imlinus
imlinus / inline-block.scss
Created November 22, 2013 12:23
inline-block mixin/placeholder
@mixin inl-block {
display: -moz-inline-stack;
display: inline-block;
vertical-align: middle;
*vertical-align: auto;
zoom: 1;
*display: inline;
}
%inline-block {
@imlinus
imlinus / position.scss
Last active December 29, 2015 02:18
position mixin
@mixin position(
$position: absolute,
$top: null,
$right: null,
$bottom: null,
$left: null
) {
position: $position;
top: $top;
right: $right;
@imlinus
imlinus / retina.scss
Created November 22, 2013 12:16
Retina mixin
$isRetina: "(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5)";
@mixin retina {
@media #{$isRetina} { @content; }
}
// usage
.logotype {
width: 100px;
@imlinus
imlinus / ir.scss
Last active December 26, 2015 19:08
ir (hide-text) mixin/placeholder
@mixin ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
%ir {
@include ir;
@imlinus
imlinus / font-face.scss
Created October 28, 2013 15:21
font-face mixin (with IE8 support)
// Mixin for custom webfonts with IE8 fallback
@mixin font-face(
$name,
$font-files,
$eot: false,
$weight: normal,
$style: normal
) {
$iefont: unquote("#{$eot}?#iefix");
@imlinus
imlinus / font-smoothing.scss
Last active December 26, 2015 18:59
Font-smoothing mixin
@mixin font-smoothing($val: antialiased) {
@include prefix(font-smoothing, $val);
}
// usage
* {
@include font-smoothing(antialiased);
}