Skip to content

Instantly share code, notes, and snippets.

@BlazOrazem
Last active May 11, 2016 07:34
Show Gist options
  • Save BlazOrazem/07c592efce9090fbdc65 to your computer and use it in GitHub Desktop.
Save BlazOrazem/07c592efce9090fbdc65 to your computer and use it in GitHub Desktop.
LESS Initial Setup
.no-border { border: 0 !important; }
.clearfix {
content: '';
clear: both;
display: block;
}
.clearfixAfter() {
&:after {
content: '';
clear: both;
display: block;
}
}
.clear(@n) {
&:nth-child(@{n}n) { clear: right; }
&:nth-child(@{n}n + 1) { clear: left; }
}
.clearAndWidth(@n) {
width: calc(100%/@n);
.clear(@n);
}
.verticalAlignParent {
/* Internet Explorer 10 */
display: -ms-flexbox;
-ms-flex-pack: center;
-ms-flex-align: center;
/* Firefox */
display: -moz-box;
-moz-box-pack: center;
-moz-box-align: center;
/* Safari, Opera, and Chrome */
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
/* W3C */
display: box;
box-pack: center;
box-align: center;
}
.gradient(@from, @to) { background: linear-gradient(to bottom, @from 0%, @from, 50%, @to 50%, @to 100%); }
.gradientDefault() { .gradient(#6B6C6E, #5E5F61); }
.gradientPrimary() { .gradient(#0B296E, #0B2369); }
.gradientInverted() { .gradient(#eaeaea, #ffffff); }
.transition(@type: all, @time: 333ms, @ease: ease-in-out) {
-webkit-transition: @type @time @ease;
-moz-transition: @type @time @ease;
-o-transition: @type @time @ease;
transition: @type @time @ease;
}
.absoluteFullsize {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.fixedFullsize {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.hidden { display: none; }
img.img-responsive {
max-width: 100%;
vertical-align: middle;
text-align: center;
}
div.tooltip {
background-color: #000;
border: 1px solid #fff;
padding: 10px;
width: 200px;
display: none;
color: @fontColorPrimaryInverted;
text-align: left;
font-size: 11px;
z-index: 200;
-moz-box-shadow: 0 0 10px #000;
-webkit-box-shadow: 0 0 10px #000;
}
#loading {
display: block;
border: 1px solid #ddd;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
width: 25px;
height: 25px;
overflow: hidden;
background: white url('/media/dsg/loader.gif') no-repeat center center;
position: absolute;
z-index: 2000;
}
.parallax { overflow: hidden; }
<!-- On-the-fly LESS compiler - Client-side compiler -->
<script type="text/javascript">var less=less||{};less.env='development';</script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/less.js/2.5.1/less.min.js"></script>
@desktop: ~"screen and (min-width: 1200px)";
@hybrid : ~"screen and (min-width: 992px)";
@tablet : ~"screen and (min-width: 768px)";
@phone : ~"screen and (max-width: 767px)";
@pocket : ~"screen and (max-width: 480px)";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment