Skip to content

Instantly share code, notes, and snippets.

@allex
Last active August 29, 2015 14:22
Show Gist options
  • Save allex/cc7227ac20bdf14f4613 to your computer and use it in GitHub Desktop.
Save allex/cc7227ac20bdf14f4613 to your computer and use it in GitHub Desktop.
/*
Compass common consts and functions
@author Allex Wang ([email protected])
GistID: cc7227ac20bdf14f4613
GistURL: https://gist.github.com/allex/cc7227ac20bdf14f4613
*/
@import "compass/css3";
@import "compass/utilities";
@import "compass/css3/transform";
@import "compass/css3/transition";
@import "compass/css3/box-sizing";
@import "compass/support";
$legacy-support-for-ie: true;
$legacy-support-for-ie6: $legacy-support-for-ie;
$legacy-support-for-ie7: $legacy-support-for-ie;
$legacy-support-for-ie8: $legacy-support-for-ie;
$legacy-support-for-mozilla: true;
$experimental-support-for-mozilla: true;
$experimental-support-for-webkit: true;
$experimental-support-for-opera: true;
$experimental-support-for-microsoft: true;
$experimental-support-for-khtml: false;
$experimental-support-for-svg: false;
$experimental-support-for-pie: false;
$support-for-original-webkit-gradients: true;
/*
media query
*/
@mixin mq($mq) {
@if $mq == 690 { @media (max-width: 690px) { @content; } }
@if $mq == 320 { @media (max-width: 320px) { @content; } }
@if $mq == retina {
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
@content;
}
}
}
// Generates a path to an asset found relative to the project's images directory.
// return simple image full path w/o cache-buster.
// @ref: <http://compass-style.org/reference/compass/helpers/urls/#image-url>
@function img-url($path) {
@return image-url($path, false, false);
}
/* global layout framework minxin defination */
@mixin doc-layout-left($left-width, $left-offset : 0) {
overflow: hidden;
.doc-g {
padding-left: $left-width + $left-offset;
height: auto;
overflow: hidden;
}
.col-l {
width: $left-width;
margin-left: ($left-width + $left-offset) * -1;
float: left;
}
@content;
}
@mixin doc-layout-right($right-width, $right-offset : 0) {
overflow: hidden;
.doc-g {
padding-right: $right-width + $right-offset;
height: auto;
overflow: hidden;
}
.col-r {
float: right;
width: $right-width;
margin-right: ($right-width + $right-offset) * -1;
}
@content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment