Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing formatString calls and multiple function signatures. #3

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
67 changes: 29 additions & 38 deletions less/css3.less
Expand Up @@ -3,25 +3,15 @@
This solution is to be used in less css and less js: http://lesscss.org/
*/

/*Border Radius Functions*/
// Border Radius Functions //
.border_radius(@radius: 10px)
{
.border_radius(@radius, @radius);
-webkit-border-radius:@radius @radius @radius @radius;
-moz-border-radius:@radius @radius @radius @radius;
border-radius:@radius @radius @radius @radius;
}

.border_radius(@radius_top, @radius_bottom)
{
.border_radius(@radius_top, @radius_top, @radius_bottom, @radius_bottom);
}

.border_radius(@radius_top_left, @radius_top_right, @radius_bottom_right, @radius_bottom_left)
{
-webkit-border-radius:@radius_top_left @radius_top_right @radius_bottom_right @radius_bottom_left;
-moz-border-radius:@radius_top_left @radius_top_right @radius_bottom_right @radius_bottom_left;
border-radius:@radius_top_left @radius_top_right @radius_bottom_right @radius_bottom_left;
}

/*Shadows*/
// Shadows //
.box_shadow(@shadow_x:3px, @shadow_y:3px, @shadow_rad:3px, @shadow_color:#888)
{
box-shadow: @shadow_x @shadow_y @shadow_rad @shadow_color;
Expand All @@ -42,15 +32,6 @@
opacity:@op/100;
}

.background_gradient(@from:#000, @to:#EEE)
{
background: @from;
background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to));
background-image: -moz-linear-gradient(top, @from, @to);
filter: formatstring("progid:DXImageTransform.Microsoft.gradient(startColorstr='{0}', endColorstr='{1}')", @from, @to); /* IE6,IE7 */
-ms-filter: formatstring("{2}progid:DXImageTransform.Microsoft.gradient(startColorStr='{0}', EndColorStr='{1}'){2}", @from, @to, '"'); /* IE8 */
}

.transition(@range: all, @time: 1s, @ease: ease-in-out)
{
-moz-transition: @range @time @ease;
Expand All @@ -59,14 +40,24 @@
transition: @range @time @ease;
}

/*Transformations*/
.skew(@angle_x:35, @angle_y:0)
.background_gradient(@from:#000, @to:#EEE)
{
-webkit-transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y));
-moz-transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y));
-o-transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y));
-ms-transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y));
transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y));
background: @from;
background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to));
background-image: -moz-linear-gradient(top, @from, @to);
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='@{from}', endColorstr='@{to})"; /* IE6,IE7 */
-ms-filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorStr='@{from}', EndColorStr='@{to})"; /* IE8 */
}


// Transformations //
.skew(@angle_x:35deg, @angle_y:0deg)
{
-webkit-transform: skew(@angle_x, @angle_y);
-moz-transform: skew(@angle_x, @angle_y);
-o-transform: skew(@angle_x, @angle_y);
-ms-transform: skew(@angle_x, @angle_y);
transform: skew(@angle_x, @angle_y);
}

.scale(@scale_x: 1)
Expand All @@ -78,13 +69,13 @@
transform: scale(@scale_x);
}

.rotate(@angle:35)
.rotate(@angle:35deg)
{
-webkit-transform: rotate(formatstring("{0}deg", @deg));
-moz-transform: rotate(formatstring("{0}deg", @deg));
-o-transform: rotate(formatstring("{0}deg", @deg));
-ms-transform: rotate(formatstring("{0}deg", @deg));
transform: rotate(formatstring("{0}deg", @deg));
-webkit-transform: rotate(@deg);
-moz-transform: rotate(@deg);
-o-transform: rotate(@deg);
-ms-transform: rotate(@deg);
transform: rotate(@deg);
}

.translate(@move_x: 10px, @move_y: 10px)
Expand All @@ -94,4 +85,4 @@
-o-transform: translate(@move_x, @move_y);
-ms-transform:translate(@move_x, @move_y);
transform: translate(@move_x, @move_y);
}
}