1
0
Fork 0
mirror of https://github.com/Oreolek/elements.git synced 2024-07-01 05:54:59 +03:00

* Add namespaces. Some mixins renamed.

fixes #2
This commit is contained in:
Ivan 2012-02-02 01:44:38 -06:00
parent 80871cd2a5
commit 1f9334f1d1

View file

@ -1,4 +1,4 @@
/*---------------------------------------------------
/*! ---------------------------------------------------
LESS Elements 0.6
---------------------------------------------------
A set of useful LESS mixins by Dmitry Fadeyev
@ -11,7 +11,8 @@
More info at: http://lesselements.com
-----------------------------------------------------*/
.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
#gradients{
.vertical(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
background: @color;
background: -webkit-gradient(linear,
left bottom,
@ -25,7 +26,7 @@
@start 0%,
@stop 100%);
}
.horizontal-gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
.horizontal(@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%);
@ -40,7 +41,7 @@
color-stop(0.3, @start)
);
}
.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) {
.bw(@color: #F5F5F5, @start: 0, @stop: 255) {
background: @color;
background: -webkit-gradient(linear,
left bottom,
@ -54,24 +55,24 @@
rgb(@start,@start,@start) 0%,
rgb(@stop,@stop,@stop) 100%);
}
}
#borders{
.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;
}
.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);
}
.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;
}
.border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) {
.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;
@ -86,12 +87,27 @@
border-top-left-radius: @topleft;
-moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;
}
.opacity(@opacity: 0.5) {
-moz-opacity: @opacity;
-khtml-opacity: @opacity;
-webkit-opacity: @opacity;
opacity: @opacity;
}
#shadows{
.drop(@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);
}
.inner(@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);
}
.box(@arguments) {
-webkit-box-shadow: @arguments;
-moz-box-shadow: @arguments;
box-shadow: @arguments;
}
}
#transform{
.rotation(@deg:5deg){
-webkit-transform: rotate(@deg);
-moz-transform: rotate(@deg);
@ -102,32 +118,41 @@
-moz-transform:scale(@ratio);
transform:scale(@ratio);
}
.transition(@duration:0.2s, @ease:ease-out) {
.translate(@x:0, @y:0) {
-moz-transform: translate(@x, @y);
-webkit-transform: translate(@x, @y);
-o-transform: translate(@x, @y);
-ms-transform: translate(@x, @y);
transform: translate(@x, @y);
}
.opacity(@opacity: 0.5) {
-moz-opacity: @opacity;
-khtml-opacity: @opacity;
-webkit-opacity: @opacity;
opacity: @opacity;
}
}
#transition{
.all(@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){
.property(@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) {
.duration(@duration: 0.2s) {
-moz-transition-duration: @duration;
-webkit-transition-duration: @duration;
transition-duration: @duration;
}
.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);
}
.box-shadow(@arguments) {
-webkit-box-shadow: @arguments;
-moz-box-shadow: @arguments;
box-shadow: @arguments;
}
#content{
.columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
-moz-column-width: @colwidth;
-moz-column-count: @colcount;
@ -148,10 +173,4 @@
column-rule-style: @columnRuleStyle;
column-rule-width: @columnRuleWidth;
}
.translate(@x:0, @y:0) {
-moz-transform: translate(@x, @y);
-webkit-transform: translate(@x, @y);
-o-transform: translate(@x, @y);
-ms-transform: translate(@x, @y);
transform: translate(@x, @y);
}