Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Malinochkin committed Feb 15, 2015
1 parent 4ab9cce commit 4721d74
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 135 deletions.
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -74,7 +74,6 @@ If you use Bower, the path would be:
````Text
// If True, then will be CSS classes, type: .z-depth-*
z-depth-css = [true | false (default)];
z-depth-browser-prefix = [true | false (default)];
z-depth-animation = [true (default) | false];
z-depth-animation-time = .28s;
z-depth-animation-function = cubic-bezier(.4, 0, .2, 1);
Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "material-shadows",
"version": "1.0.0",
"version": "1.0.1",
"authors": [
"Denis Malinochkin <dmalinochkin@land.ru>"
],
Expand Down
14 changes: 2 additions & 12 deletions material-shadows-prefixed.less
Expand Up @@ -2,7 +2,7 @@
//
// Name: Material Shadows
// Description: Paper shadows of material design.
// Version: 1.0.0
// Version: 1.0.1
//
// Author: Denis Malinochkin
// Git: https://github.com/mrmlnc/material-shadows
Expand All @@ -15,7 +15,6 @@
// --------------------------------------------------------------------------------

@md-z-depth-css: false;
@md-z-depth-browser-prefix: false;
@md-z-depth-animation: true;
@md-z-depth-animation-time: .28s;
@md-z-depth-animation-function: cubic-bezier(.4, 0, .2, 1);
Expand Down Expand Up @@ -116,16 +115,7 @@
.md-z-depth-z3,
.md-z-depth-z4,
.md-z-depth-z5 {
& when (@md-z-depth-browser-prefix = false) {
transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
}

& when (@md-z-depth-browser-prefix = true) {
-webkit-transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
-moz-transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
-o-transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
}
transition: box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
}
}
}
Expand Down
38 changes: 5 additions & 33 deletions material-shadows-prefixed.scss
Expand Up @@ -2,7 +2,7 @@
//
// Name: Material Shadows
// Description: Paper shadows of material design.
// Version: 1.0.0
// Version: 1.0.1
//
// Author: Denis Malinochkin
// Git: https://github.com/mrmlnc/material-shadows
Expand All @@ -15,7 +15,6 @@
// --------------------------------------------------------------------------------

$md-z-depth-css: false;
$md-z-depth-browser-prefix: false;
$md-z-depth-animation: true;
$md-z-depth-animation-time: .28s;
$md-z-depth-animation-function: cubic-bezier(.4, 0, .2, 1);
Expand Down Expand Up @@ -47,41 +46,14 @@ $md-z-depth: (
// Mixins
// --------------------------------------------------------------------------------

@mixin md-prefixer ($property, $value, $prefixes) {
@if $md-z-depth-browser-prefix {
@each $prefix in $prefixes {
@if $prefix == webkit {
-webkit-#{$property}: $value;
}
@else if $prefix == moz {
-moz-#{$property}: $value;
}
@else if $prefix == ms {
-ms-#{$property}: $value;
}
@else if $prefix == o {
-o-#{$property}: $value;
}
@else if $prefix == spec {
#{$property}: $value;
}
@else {
@warn "Unrecognized prefix: #{$prefix}";
}
}
} @else {
#{$property}: $value;
}
}

// Top & Bottom
@mixin md-z-depth($depth: 1, $orientation: null) {
@if $orientation == top {
@include md-prefixer(box-shadow, nth(nth($md-z-depth, $depth), 1), spec);
box-shadow: nth(nth($md-z-depth, $depth), 1);
} @else if $orientation == bottom {
@include md-prefixer(box-shadow, nth(nth($md-z-depth, $depth), 2), spec);
box-shadow: nth(nth($md-z-depth, $depth), 2);
} @else {
@include md-prefixer(box-shadow, nth($md-z-depth, $depth), spec);
box-shadow: nth($md-z-depth, $depth);
}
}

Expand Down Expand Up @@ -140,7 +112,7 @@ $md-z-depth: (
.z-depth-z3,
.z-depth-z4,
.z-depth-z5 {
@include md-prefixer(transition, box-shadow $md-z-depth-animation-time $md-z-depth-animation-function, webkit o spec);
transition: box-shadow $md-z-depth-animation-time $md-z-depth-animation-function;
}
}
}
Expand Down
27 changes: 5 additions & 22 deletions material-shadows-prefixed.styl
Expand Up @@ -2,7 +2,7 @@
//
// Name: Material Shadows
// Description: Paper shadows of material design.
// Version: 1.0.0
// Version: 1.0.1
//
// Author: Denis Malinochkin
// Git: https://github.com/mrmlnc/material-shadows
Expand All @@ -15,7 +15,6 @@
// --------------------------------------------------------------------------------

$md-z-depth-css = false;
$md-z-depth-browser-prefix = false;
$md-z-depth-animation = true;
$md-z-depth-animation-time = .28s;
$md-z-depth-animation-function = cubic-bezier(.4, 0, .2, 1);
Expand Down Expand Up @@ -57,32 +56,16 @@ $md-z-depth = {
// Mixins
// --------------------------------------------------------------------------------

md-prefixer($property, $value, $prefixes)
if $md-z-depth-browser-prefix
for $prefix in $prefixes
if $prefix == webkit
-webkit-{$property}: $value
else if $prefix == moz
-moz-{$property}: $value
else if $prefix == ms
-ms-{$property}: $value
else if $prefix == o
-o-{$property}: $value
else if $prefix == spec
{$property}: $value
else
{$property}: $value

// Top & Bottom
md-z-depth($depth = 1, $orientation = null)
$value = $md-z-depth["z" + $depth]

if $orientation == top
md-prefixer(box-shadow, $value["top"], spec)
box-shadow: $value["top"]
else if $orientation == bottom
md-prefixer(box-shadow, $value["bottom"], spec)
box-shadow: $value["bottom"]
else
md-prefixer(box-shadow, s(join(', ', $value["top"], $value["bottom"])), spec)
box-shadow: s(join(', ', $value["top"], $value["bottom"]))

// Top
md-z-depth-top($depth = 1)
Expand Down Expand Up @@ -129,4 +112,4 @@ if $md-z-depth-css
.z-depth-z3,
.z-depth-z4,
.z-depth-z5
md-prefixer(transition, box-shadow $z-depth-animation-time $z-depth-animation-function, webkit o spec)
transition: box-shadow $md-z-depth-animation-time $md-z-depth-animation-function
13 changes: 2 additions & 11 deletions material-shadows.less
Expand Up @@ -2,7 +2,7 @@
//
// Name: Material Shadows
// Description: Paper shadows of material design.
// Version: 1.0.0
// Version: 1.0.1
//
// Author: Denis Malinochkin
// Git: https://github.com/mrmlnc/material-shadows
Expand All @@ -15,7 +15,6 @@
// --------------------------------------------------------------------------------

@z-depth-css: false;
@z-depth-browser-prefix: false;
@z-depth-animation: true;
@z-depth-animation-time: .28s;
@z-depth-animation-function: cubic-bezier(.4, 0, .2, 1);
Expand Down Expand Up @@ -115,15 +114,7 @@
.z-depth-z3,
.z-depth-z4,
.z-depth-z5 {
& when (@z-depth-browser-prefix = false) {
transition:box-shadow @z-depth-animation-time @z-depth-animation-function;
}

& when (@z-depth-browser-prefix = true) {
-webkit-transition:box-shadow @z-depth-animation-time @z-depth-animation-function;
-o-transition:box-shadow @z-depth-animation-time @z-depth-animation-function;
transition:box-shadow @z-depth-animation-time @z-depth-animation-function;
}
transition: box-shadow @z-depth-animation-time @z-depth-animation-function;
}
}
}
Expand Down
38 changes: 5 additions & 33 deletions material-shadows.scss
Expand Up @@ -2,7 +2,7 @@
//
// Name: Material Shadows
// Description: Paper shadows of material design.
// Version: 1.0.0
// Version: 1.0.1
//
// Author: Denis Malinochkin
// Git: https://github.com/mrmlnc/material-shadows
Expand All @@ -15,7 +15,6 @@
// --------------------------------------------------------------------------------

$z-depth-css: false;
$z-depth-browser-prefix: false;
$z-depth-animation: true;
$z-depth-animation-time: .28s;
$z-depth-animation-function: cubic-bezier(.4, 0, .2, 1);
Expand Down Expand Up @@ -47,43 +46,16 @@ $z-depth: (
// Mixins
// --------------------------------------------------------------------------------

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

// Top & Bottom
@mixin z-depth($depth: 1, $orientation: null) {
@if $orientation == top {
@include prefixer(box-shadow, nth(nth($z-depth, $depth), 1), spec);
box-shadow: nth(nth($z-depth, $depth), 1);
}
@else if $orientation == bottom {
@include prefixer(box-shadow, nth(nth($z-depth, $depth), 2), spec);
box-shadow: nth(nth($z-depth, $depth), 2);
}
@else {
@include prefixer(box-shadow, nth($z-depth, $depth), spec);
box-shadow: nth($z-depth, $depth);
}
}

Expand Down Expand Up @@ -144,7 +116,7 @@ $z-depth: (
.z-depth-z3,
.z-depth-z4,
.z-depth-z5 {
@include prefixer(transition, box-shadow $z-depth-animation-time $z-depth-animation-function, webkit o spec);
transition: box-shadow $z-depth-animation-time $z-depth-animation-function;
}
}
}
Expand Down
27 changes: 5 additions & 22 deletions material-shadows.styl
Expand Up @@ -2,7 +2,7 @@
//
// Name: Material Shadows
// Description: Paper shadows of material design.
// Version: 1.0.0
// Version: 1.0.1
//
// Author: Denis Malinochkin
// Git: https://github.com/mrmlnc/material-shadows
Expand All @@ -15,7 +15,6 @@
// --------------------------------------------------------------------------------

$z-depth-css = false;
$z-depth-browser-prefix = false;
$z-depth-animation = true;
$z-depth-animation-time = .28s;
$z-depth-animation-function = cubic-bezier(.4, 0, .2, 1);
Expand Down Expand Up @@ -57,32 +56,16 @@ $z-depth = {
// Mixins
// --------------------------------------------------------------------------------

prefixer($property, $value, $prefixes)
if $z-depth-browser-prefix
for $prefix in $prefixes
if $prefix == webkit
-webkit-{$property}: $value
else if $prefix == moz
-moz-{$property}: $value
else if $prefix == ms
-ms-{$property}: $value
else if $prefix == o
-o-{$property}: $value
else if $prefix == spec
{$property}: $value
else
{$property}: $value

// Top & Bottom
z-depth($depth = 1, $orientation = null)
$value = $z-depth["z" + $depth]

if $orientation == top
prefixer(box-shadow, $value["top"], spec)
box-shadow: $value["top"]
else if $orientation == bottom
prefixer(box-shadow, $value["bottom"], spec)
box-shadow: $value["bottom"]
else
prefixer(box-shadow, s(join(', ', $value["top"], $value["bottom"])), spec)
box-shadow: s(join(', ', $value["top"], $value["bottom"]))

// Top
z-depth-top($depth = 1)
Expand Down Expand Up @@ -129,4 +112,4 @@ if $z-depth-css
.z-depth-z3,
.z-depth-z4,
.z-depth-z5
prefixer(transition, box-shadow $z-depth-animation-time $z-depth-animation-function, webkit o spec)
transition: box-shadow $z-depth-animation-time $z-depth-animation-function

0 comments on commit 4721d74

Please sign in to comment.