Skip to content

Commit

Permalink
ax5core 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasJang committed Jan 7, 2016
1 parent 550669d commit 032e8c6
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ax5core",
"version": "0.3.0",
"version": "0.4.0",
"description": "`ax5core` is a collection of utility functions that have been designed for use in ax5ui",
"license": "MIT",
"repository": {
Expand Down
96 changes: 96 additions & 0 deletions src/_ax5-ui-mixin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/** require bourbon */
/** ax5-ui-mixin : version 1.0 */

@mixin placeholder($color: $input-color-placeholder) {
// Firefox
&::-moz-placeholder {
color: $color;
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
}
&:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
&::-webkit-input-placeholder { color: $color; } // Safari and Chrome
}

@mixin prefixer($property, $value, $prefixes) {
@each $prefix in $prefixes {
@if $prefix == webkit {
@if $prefix-for-webkit {
-webkit-#{$property}: $value;
}
} @else if $prefix == moz {
@if $prefix-for-mozilla {
-moz-#{$property}: $value;
}
} @else if $prefix == ms {
@if $prefix-for-microsoft {
-ms-#{$property}: $value;
}
} @else if $prefix == o {
@if $prefix-for-opera {
-o-#{$property}: $value;
}
} @else if $prefix == spec {
@if $prefix-for-spec {
#{$property}: $value;
}
} @else {
@warn "Unrecognized prefix: #{$prefix}";
}
}
}

@mixin box-shadow ($shadows...) {
@include prefixer(box-shadow, $shadows, spec);
}

@mixin background-size ($lengths...) {
@include prefixer(background-size, $lengths, spec);
}

@mixin ax-border-radius($border-radius, $direction:"", $adjust:0){
@if (type_of($border-radius) == "list") {
@if($direction == ""){
border-top-left-radius: nth($border-radius, 1)+$adjust;
border-top-right-radius: nth($border-radius, 2)+$adjust;
border-bottom-right-radius: nth($border-radius, 3)+$adjust;
border-bottom-left-radius: nth($border-radius, 4)+$adjust;
}
@else if($direction == "top") {
border-top-left-radius: nth($border-radius, 1)+$adjust;
border-top-right-radius: nth($border-radius, 2)+$adjust;
}
@else if($direction == "bottom") {
border-bottom-right-radius: nth($border-radius, 3)+$adjust;
border-bottom-left-radius: nth($border-radius, 4)+$adjust;
}
@else if($direction == "left") {
border-top-left-radius: nth($border-radius, 1)+$adjust;
border-bottom-left-radius: nth($border-radius, 4)+$adjust;
}
@else if($direction == "right") {
border-top-right-radius: nth($border-radius, 2)+$adjust;
border-bottom-right-radius: nth($border-radius, 3)+$adjust;
}
}
@else {
@if($direction == "") {
border-radius: $border-radius+$adjust;
}
@else if($direction == "top") {
border-top-left-radius: $border-radius+$adjust;
border-top-right-radius: $border-radius+$adjust;
}
@else if($direction == "bottom") {
border-bottom-left-radius: $border-radius+$adjust;
border-bottom-right-radius: $border-radius+$adjust;
}
@else if($direction == "left") {
border-top-left-radius: $border-radius+$adjust;
border-bottom-left-radius: $border-radius+$adjust;
}
@else if($direction == "right") {
border-top-right-radius: $border-radius+$adjust;
border-bottom-right-radius: $border-radius+$adjust;
}
}
}

0 comments on commit 032e8c6

Please sign in to comment.