Skip to content

Commit 4721d74

Browse files
author
Denis Malinochkin
committed
v1.0.1
1 parent 4ab9cce commit 4721d74

File tree

8 files changed

+25
-135
lines changed

8 files changed

+25
-135
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ If you use Bower, the path would be:
7474
````Text
7575
// If True, then will be CSS classes, type: .z-depth-*
7676
z-depth-css = [true | false (default)];
77-
z-depth-browser-prefix = [true | false (default)];
7877
z-depth-animation = [true (default) | false];
7978
z-depth-animation-time = .28s;
8079
z-depth-animation-function = cubic-bezier(.4, 0, .2, 1);

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "material-shadows",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"authors": [
55
"Denis Malinochkin <[email protected]>"
66
],

material-shadows-prefixed.less

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Name: Material Shadows
44
// Description: Paper shadows of material design.
5-
// Version: 1.0.0
5+
// Version: 1.0.1
66
//
77
// Author: Denis Malinochkin
88
// Git: https://github.com/mrmlnc/material-shadows
@@ -15,7 +15,6 @@
1515
// --------------------------------------------------------------------------------
1616

1717
@md-z-depth-css: false;
18-
@md-z-depth-browser-prefix: false;
1918
@md-z-depth-animation: true;
2019
@md-z-depth-animation-time: .28s;
2120
@md-z-depth-animation-function: cubic-bezier(.4, 0, .2, 1);
@@ -116,16 +115,7 @@
116115
.md-z-depth-z3,
117116
.md-z-depth-z4,
118117
.md-z-depth-z5 {
119-
& when (@md-z-depth-browser-prefix = false) {
120-
transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
121-
}
122-
123-
& when (@md-z-depth-browser-prefix = true) {
124-
-webkit-transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
125-
-moz-transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
126-
-o-transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
127-
transition:box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
128-
}
118+
transition: box-shadow @md-z-depth-animation-time @md-z-depth-animation-function;
129119
}
130120
}
131121
}

material-shadows-prefixed.scss

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Name: Material Shadows
44
// Description: Paper shadows of material design.
5-
// Version: 1.0.0
5+
// Version: 1.0.1
66
//
77
// Author: Denis Malinochkin
88
// Git: https://github.com/mrmlnc/material-shadows
@@ -15,7 +15,6 @@
1515
// --------------------------------------------------------------------------------
1616

1717
$md-z-depth-css: false;
18-
$md-z-depth-browser-prefix: false;
1918
$md-z-depth-animation: true;
2019
$md-z-depth-animation-time: .28s;
2120
$md-z-depth-animation-function: cubic-bezier(.4, 0, .2, 1);
@@ -47,41 +46,14 @@ $md-z-depth: (
4746
// Mixins
4847
// --------------------------------------------------------------------------------
4948

50-
@mixin md-prefixer ($property, $value, $prefixes) {
51-
@if $md-z-depth-browser-prefix {
52-
@each $prefix in $prefixes {
53-
@if $prefix == webkit {
54-
-webkit-#{$property}: $value;
55-
}
56-
@else if $prefix == moz {
57-
-moz-#{$property}: $value;
58-
}
59-
@else if $prefix == ms {
60-
-ms-#{$property}: $value;
61-
}
62-
@else if $prefix == o {
63-
-o-#{$property}: $value;
64-
}
65-
@else if $prefix == spec {
66-
#{$property}: $value;
67-
}
68-
@else {
69-
@warn "Unrecognized prefix: #{$prefix}";
70-
}
71-
}
72-
} @else {
73-
#{$property}: $value;
74-
}
75-
}
76-
7749
// Top & Bottom
7850
@mixin md-z-depth($depth: 1, $orientation: null) {
7951
@if $orientation == top {
80-
@include md-prefixer(box-shadow, nth(nth($md-z-depth, $depth), 1), spec);
52+
box-shadow: nth(nth($md-z-depth, $depth), 1);
8153
} @else if $orientation == bottom {
82-
@include md-prefixer(box-shadow, nth(nth($md-z-depth, $depth), 2), spec);
54+
box-shadow: nth(nth($md-z-depth, $depth), 2);
8355
} @else {
84-
@include md-prefixer(box-shadow, nth($md-z-depth, $depth), spec);
56+
box-shadow: nth($md-z-depth, $depth);
8557
}
8658
}
8759

@@ -140,7 +112,7 @@ $md-z-depth: (
140112
.z-depth-z3,
141113
.z-depth-z4,
142114
.z-depth-z5 {
143-
@include md-prefixer(transition, box-shadow $md-z-depth-animation-time $md-z-depth-animation-function, webkit o spec);
115+
transition: box-shadow $md-z-depth-animation-time $md-z-depth-animation-function;
144116
}
145117
}
146118
}

material-shadows-prefixed.styl

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Name: Material Shadows
44
// Description: Paper shadows of material design.
5-
// Version: 1.0.0
5+
// Version: 1.0.1
66
//
77
// Author: Denis Malinochkin
88
// Git: https://github.com/mrmlnc/material-shadows
@@ -15,7 +15,6 @@
1515
// --------------------------------------------------------------------------------
1616

1717
$md-z-depth-css = false;
18-
$md-z-depth-browser-prefix = false;
1918
$md-z-depth-animation = true;
2019
$md-z-depth-animation-time = .28s;
2120
$md-z-depth-animation-function = cubic-bezier(.4, 0, .2, 1);
@@ -57,32 +56,16 @@ $md-z-depth = {
5756
// Mixins
5857
// --------------------------------------------------------------------------------
5958

60-
md-prefixer($property, $value, $prefixes)
61-
if $md-z-depth-browser-prefix
62-
for $prefix in $prefixes
63-
if $prefix == webkit
64-
-webkit-{$property}: $value
65-
else if $prefix == moz
66-
-moz-{$property}: $value
67-
else if $prefix == ms
68-
-ms-{$property}: $value
69-
else if $prefix == o
70-
-o-{$property}: $value
71-
else if $prefix == spec
72-
{$property}: $value
73-
else
74-
{$property}: $value
75-
7659
// Top & Bottom
7760
md-z-depth($depth = 1, $orientation = null)
7861
$value = $md-z-depth["z" + $depth]
7962

8063
if $orientation == top
81-
md-prefixer(box-shadow, $value["top"], spec)
64+
box-shadow: $value["top"]
8265
else if $orientation == bottom
83-
md-prefixer(box-shadow, $value["bottom"], spec)
66+
box-shadow: $value["bottom"]
8467
else
85-
md-prefixer(box-shadow, s(join(', ', $value["top"], $value["bottom"])), spec)
68+
box-shadow: s(join(', ', $value["top"], $value["bottom"]))
8669

8770
// Top
8871
md-z-depth-top($depth = 1)
@@ -129,4 +112,4 @@ if $md-z-depth-css
129112
.z-depth-z3,
130113
.z-depth-z4,
131114
.z-depth-z5
132-
md-prefixer(transition, box-shadow $z-depth-animation-time $z-depth-animation-function, webkit o spec)
115+
transition: box-shadow $md-z-depth-animation-time $md-z-depth-animation-function

material-shadows.less

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Name: Material Shadows
44
// Description: Paper shadows of material design.
5-
// Version: 1.0.0
5+
// Version: 1.0.1
66
//
77
// Author: Denis Malinochkin
88
// Git: https://github.com/mrmlnc/material-shadows
@@ -15,7 +15,6 @@
1515
// --------------------------------------------------------------------------------
1616

1717
@z-depth-css: false;
18-
@z-depth-browser-prefix: false;
1918
@z-depth-animation: true;
2019
@z-depth-animation-time: .28s;
2120
@z-depth-animation-function: cubic-bezier(.4, 0, .2, 1);
@@ -115,15 +114,7 @@
115114
.z-depth-z3,
116115
.z-depth-z4,
117116
.z-depth-z5 {
118-
& when (@z-depth-browser-prefix = false) {
119-
transition:box-shadow @z-depth-animation-time @z-depth-animation-function;
120-
}
121-
122-
& when (@z-depth-browser-prefix = true) {
123-
-webkit-transition:box-shadow @z-depth-animation-time @z-depth-animation-function;
124-
-o-transition:box-shadow @z-depth-animation-time @z-depth-animation-function;
125-
transition:box-shadow @z-depth-animation-time @z-depth-animation-function;
126-
}
117+
transition: box-shadow @z-depth-animation-time @z-depth-animation-function;
127118
}
128119
}
129120
}

material-shadows.scss

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Name: Material Shadows
44
// Description: Paper shadows of material design.
5-
// Version: 1.0.0
5+
// Version: 1.0.1
66
//
77
// Author: Denis Malinochkin
88
// Git: https://github.com/mrmlnc/material-shadows
@@ -15,7 +15,6 @@
1515
// --------------------------------------------------------------------------------
1616

1717
$z-depth-css: false;
18-
$z-depth-browser-prefix: false;
1918
$z-depth-animation: true;
2019
$z-depth-animation-time: .28s;
2120
$z-depth-animation-function: cubic-bezier(.4, 0, .2, 1);
@@ -47,43 +46,16 @@ $z-depth: (
4746
// Mixins
4847
// --------------------------------------------------------------------------------
4948

50-
@mixin prefixer ($property, $value, $prefixes) {
51-
@if $z-depth-browser-prefix {
52-
@each $prefix in $prefixes {
53-
@if $prefix == webkit {
54-
-webkit-#{$property}: $value;
55-
}
56-
@else if $prefix == moz {
57-
-moz-#{$property}: $value;
58-
}
59-
@else if $prefix == ms {
60-
-ms-#{$property}: $value;
61-
}
62-
@else if $prefix == o {
63-
-o-#{$property}: $value;
64-
}
65-
@else if $prefix == spec {
66-
#{$property}: $value;
67-
}
68-
@else {
69-
@warn "Unrecognized prefix: #{$prefix}";
70-
}
71-
}
72-
} @else {
73-
#{$property}: $value;
74-
}
75-
}
76-
7749
// Top & Bottom
7850
@mixin z-depth($depth: 1, $orientation: null) {
7951
@if $orientation == top {
80-
@include prefixer(box-shadow, nth(nth($z-depth, $depth), 1), spec);
52+
box-shadow: nth(nth($z-depth, $depth), 1);
8153
}
8254
@else if $orientation == bottom {
83-
@include prefixer(box-shadow, nth(nth($z-depth, $depth), 2), spec);
55+
box-shadow: nth(nth($z-depth, $depth), 2);
8456
}
8557
@else {
86-
@include prefixer(box-shadow, nth($z-depth, $depth), spec);
58+
box-shadow: nth($z-depth, $depth);
8759
}
8860
}
8961

@@ -144,7 +116,7 @@ $z-depth: (
144116
.z-depth-z3,
145117
.z-depth-z4,
146118
.z-depth-z5 {
147-
@include prefixer(transition, box-shadow $z-depth-animation-time $z-depth-animation-function, webkit o spec);
119+
transition: box-shadow $z-depth-animation-time $z-depth-animation-function;
148120
}
149121
}
150122
}

material-shadows.styl

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Name: Material Shadows
44
// Description: Paper shadows of material design.
5-
// Version: 1.0.0
5+
// Version: 1.0.1
66
//
77
// Author: Denis Malinochkin
88
// Git: https://github.com/mrmlnc/material-shadows
@@ -15,7 +15,6 @@
1515
// --------------------------------------------------------------------------------
1616

1717
$z-depth-css = false;
18-
$z-depth-browser-prefix = false;
1918
$z-depth-animation = true;
2019
$z-depth-animation-time = .28s;
2120
$z-depth-animation-function = cubic-bezier(.4, 0, .2, 1);
@@ -57,32 +56,16 @@ $z-depth = {
5756
// Mixins
5857
// --------------------------------------------------------------------------------
5958

60-
prefixer($property, $value, $prefixes)
61-
if $z-depth-browser-prefix
62-
for $prefix in $prefixes
63-
if $prefix == webkit
64-
-webkit-{$property}: $value
65-
else if $prefix == moz
66-
-moz-{$property}: $value
67-
else if $prefix == ms
68-
-ms-{$property}: $value
69-
else if $prefix == o
70-
-o-{$property}: $value
71-
else if $prefix == spec
72-
{$property}: $value
73-
else
74-
{$property}: $value
75-
7659
// Top & Bottom
7760
z-depth($depth = 1, $orientation = null)
7861
$value = $z-depth["z" + $depth]
7962

8063
if $orientation == top
81-
prefixer(box-shadow, $value["top"], spec)
64+
box-shadow: $value["top"]
8265
else if $orientation == bottom
83-
prefixer(box-shadow, $value["bottom"], spec)
66+
box-shadow: $value["bottom"]
8467
else
85-
prefixer(box-shadow, s(join(', ', $value["top"], $value["bottom"])), spec)
68+
box-shadow: s(join(', ', $value["top"], $value["bottom"]))
8669

8770
// Top
8871
z-depth-top($depth = 1)
@@ -129,4 +112,4 @@ if $z-depth-css
129112
.z-depth-z3,
130113
.z-depth-z4,
131114
.z-depth-z5
132-
prefixer(transition, box-shadow $z-depth-animation-time $z-depth-animation-function, webkit o spec)
115+
transition: box-shadow $z-depth-animation-time $z-depth-animation-function

0 commit comments

Comments
 (0)