1
0
Fork 0
mirror of https://github.com/Oreolek/elements.git synced 2024-05-03 17:39:21 +03:00
less-elements/elements.less

157 lines
5.9 KiB
Plaintext
Raw Normal View History

2011-04-29 02:07:44 +03:00
/*---------------------------------------------------
2011-09-16 08:14:14 +03:00
LESS Elements 0.6
---------------------------------------------------
A set of useful LESS mixins by Dmitry Fadeyev
Special thanks for mixin suggestions to:
Kris Van Herzeele,
Benoit Adam,
2011-09-16 08:14:14 +03:00
Portenart Emile-Victor,
Ryan Faerman
More info at: http://lesselements.com
2011-04-29 02:07:44 +03:00
-----------------------------------------------------*/
2011-07-01 00:22:48 +03:00
.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
background: @color;
background: -webkit-gradient(linear,
left bottom,
left top,
2011-09-27 22:55:23 +03:00
color-stop(0, @start),
2011-09-27 22:57:11 +03:00
color-stop(1, @stop));
2011-09-21 14:46:51 +03:00
background: -ms-linear-gradient(bottom,
@start,
@stop);
background: -moz-linear-gradient(center bottom,
@start 0%,
@stop 100%);
2011-07-01 00:22:48 +03:00
}
.horizontal-gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
background: @color;
background-image: linear-gradient(right , @stop 0%, @start 100%);
background-image: -o-linear-gradient(right , @stop 0%, @start 100%);
background-image: -moz-linear-gradient(right , @stop 0%, @start 100%);
background-image: -webkit-linear-gradient(right , @stop 0%, @start 100%);
background-image: -ms-linear-gradient(right , @stop 0%, @start 100%);
background-image: -webkit-gradient(
linear,
right top,
left top,
color-stop(0, @stop),
color-stop(0.3, @start)
);
}
2011-04-29 02:07:44 +03:00
.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) {
background: @color;
background: -webkit-gradient(linear,
left bottom,
left top,
color-stop(0, rgb(@start,@start,@start)),
color-stop(1, rgb(@stop,@stop,@stop)));
2011-09-21 14:50:20 +03:00
background: -ms-linear-gradient(bottom,
rgb(@start,@start,@start) 0%,
rgb(@start,@start,@start) 100%);
background: -moz-linear-gradient(center bottom,
rgb(@start,@start,@start) 0%,
rgb(@stop,@stop,@stop) 100%);
2011-04-29 02:07:44 +03:00
}
.bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
border-top: solid 1px @top-color;
border-left: solid 1px @left-color;
border-right: solid 1px @right-color;
border-bottom: solid 1px @bottom-color;
2011-04-29 02:07:44 +03:00
}
.drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
-webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
-moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
2011-04-29 02:07:44 +03:00
}
.rounded(@radius: 2px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
-moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;
2011-04-29 02:07:44 +03:00
}
.border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) {
-webkit-border-top-right-radius: @topright;
-webkit-border-bottom-right-radius: @bottomright;
-webkit-border-bottom-left-radius: @bottomleft;
-webkit-border-top-left-radius: @topleft;
-moz-border-radius-topright: @topright;
-moz-border-radius-bottomright: @bottomright;
-moz-border-radius-bottomleft: @bottomleft;
-moz-border-radius-topleft: @topleft;
border-top-right-radius: @topright;
border-bottom-right-radius: @bottomright;
border-bottom-left-radius: @bottomleft;
border-top-left-radius: @topleft;
-moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;
2011-04-29 02:07:44 +03:00
}
.opacity(@opacity: 0.5) {
-moz-opacity: @opacity;
-khtml-opacity: @opacity;
-webkit-opacity: @opacity;
opacity: @opacity;
2011-04-29 02:07:44 +03:00
}
.rotation(@deg:5deg){
2011-04-29 02:07:44 +03:00
-webkit-transform: rotate(@deg);
-moz-transform: rotate(@deg);
transform: rotate(@deg);
}
.scale(@ratio:1.5){
-webkit-transform:scale(@ratio);
-moz-transform:scale(@ratio);
transform:scale(@ratio);
2011-04-29 02:07:44 +03:00
}
.transition(@duration:0.2s, @ease:ease-out) {
-webkit-transition: all @duration @ease;
-moz-transition: all @duration @ease;
transition: all @duration @ease;
}
.transition-prop(@property: width,@delay: 200ms, @ease:ease-out){
transition: @property @delay @ease;
-moz-transition: @property @delay @ease;
-webkit-transition: @property @delay @ease;
-o-transition: @property @delay @ease;
}
.transition-duration(@duration: 0.2s) {
-moz-transition-duration: @duration;
-webkit-transition-duration: @duration;
transition-duration: @duration;
}
2011-04-29 02:07:44 +03:00
.inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
-webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
-moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
2011-04-29 02:07:44 +03:00
}
.box-shadow(@arguments) {
-webkit-box-shadow: @arguments;
-moz-box-shadow: @arguments;
box-shadow: @arguments;
2011-04-29 02:07:44 +03:00
}
.columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
-moz-column-width: @colwidth;
-moz-column-count: @colcount;
-moz-column-gap: @colgap;
-moz-column-rule-color: @columnRuleColor;
-moz-column-rule-style: @columnRuleStyle;
-moz-column-rule-width: @columnRuleWidth;
-webkit-column-width: @colwidth;
-webkit-column-count: @colcount;
-webkit-column-gap: @colgap;
-webkit-column-rule-color: @columnRuleColor;
-webkit-column-rule-style: @columnRuleStyle;
-webkit-column-rule-width: @columnRuleWidth;
column-width: @colwidth;
column-count: @colcount;
column-gap: @colgap;
column-rule-color: @columnRuleColor;
column-rule-style: @columnRuleStyle;
column-rule-width: @columnRuleWidth;
}
2011-09-16 08:14:14 +03:00
.translate(@x:0, @y:0) {
2011-09-16 08:16:21 +03:00
-moz-transform: translate(@x, @y);
-webkit-transform: translate(@x, @y);
-o-transform: translate(@x, @y);
-ms-transform: translate(@x, @y);
transform: translate(@x, @y);
}