Skip to content

Instantly share code, notes, and snippets.

@enumag
Created February 16, 2012 21:51
Show Gist options
  • Select an option

  • Save enumag/1848142 to your computer and use it in GitHub Desktop.

Select an option

Save enumag/1848142 to your computer and use it in GitHub Desktop.
ISS mixins
@gradient-x($left, $right: $left) {
background-image: -o-linear-gradient(left,$left,$right);
background-image: -ms-linear-gradient(left,$left,$right);
background-image: -moz-linear-gradient(left,$left,$right);
background-image: -webkit-gradient(linear,left top,right top,color-stop(0,$left),color-stop(1,$right));
$ie: 'progid:DXImageTransform.Microsoft.gradient(startColorStr=' . iergba($left) . ',EndColorStr=' . iergba($right) . ',GradientType=1)';
%filter: $ie;
-ms-filter: $ie;
}
@gradient-y($top, $bottom: $top) {
background-image: -o-linear-gradient(top,$top 100%,$bottom);
background-image: -ms-linear-gradient(top,$top 100%,$bottom);
background-image: -moz-linear-gradient(top,$top 100%,$bottom);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0,$top),color-stop(1,$bottom));
$ie: 'progid:DXImageTransform.Microsoft.gradient(startColorStr=' . iergba($top) . ',EndColorStr=' . iergba($bottom) . ')';
%filter: $ie;
-ms-filter: $ie;
}
@transform() {
-webkit-transform: $_argv;
-moz-transform: $_argv;
-ms-transform: $_argv;
-o-transform: $_argv;
transform: $_argv;
}
@border-radius-simple($x, $y: $x) {
-webkit-border-radius: $x $y;
$radius: raw($x . '/' . $y);
-khtml-border-radius: $radius;
-moz-border-radius: $radius;
border-radius: $radius;
}
@resize($direction: both) {
overflow: hidden;
resize: $direction;
}
@ellipsis() {
white-space: nowrap;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
@opacity($opacity) {
-khtml-opacity: $opacity;
-moz-opacity: $opacity;
opacity: $opacity;
$ie: $opacity * 100;
%filter: 'alpha(opacity=' . $ie . ')';
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(opacity=' . $ie . ')';
}
@background-size() {
-webkit-background-size: $_argv;
-khtml-background-size: $_argv;
-moz-background-size: $_argv;
-o-background-size: $_argv;
background-size: $_argv;
}
@border-image() {
-webkit-border-image: $_argv;
-khtml-border-image: $_argv;
-icab-border-image: $_argv;
-moz-border-image: $image;
-o-border-image: $_argv;
border-image: $_argv;
}
@border-radius($topleft, $topright, $bottomright, $bottomleft) {
border-top-left-radius: $topleft;
border-top-right-radius: $topright;
border-bottom-left-radius: $bottomleft;
border-bottom-right-radius: $bottomright;
-moz-border-radius-topleft: $topleft;
-moz-border-radius-topright: $topright;
-moz-border-radius-bottomleft: $bottomleft;
-moz-border-radius-bottomright: $bottomright;
-webkit-border-top-left-radius: $topleft;
-webkit-border-top-right-radius: $topright;
-webkit-border-bottom-left-radius: $bottomleft;
-webkit-border-bottom-right-radius: $bottomright;
}
@box-shadow() {
-webkit-box-shadow: $_argv;
-moz-box-shadow: $_argv;
box-shadow: $_argv;
}
@box-sizing() {
-webkit-box-sizing: $_argv;
-moz-box-sizing: $_argv;
box-sizing: $_argv;
}
@self-clear() {
zoom: 1#;
&:after {
content: '';
display: block;
clear: both;
}
}
@size($width, $height: $width) {
width: $width * 1px;
height: $height * 1px;
}
@hyphens($mode: auto) {
-webkit-hyphens: $mode;
-moz-hyphens: $mode;
-ms-hyphens: $mode;
hyphens: $mode;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment