Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit f84475b

Browse files
committed
Buttons: Playing around with shadows
1 parent b6e7feb commit f84475b

File tree

3 files changed

+35
-7
lines changed

3 files changed

+35
-7
lines changed

scss/atoms/buttons/_buttons.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
.btn {
1212
border: 1px solid transparent;
1313
cursor: pointer;
14+
letter-spacing: map-get($ui-btn, letter-spacing);
1415
font-family: $ui-btn-font;
1516
font-weight: map-get($ui-btn, font-weight);
1617
margin: map-get($ui-btn, margin);

scss/atoms/buttons/_mixins.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
color: map-get($btn-colors, color);
33
background: map-deep-get($btn-colors, "background", "base");
44
border-color: map-get($btn-colors, border);
5+
@if (map-get($btn-colors, shadow) == true) {
6+
transition: map-get($ui-btn-shadows, transition);
7+
box-shadow: map-get($ui-btn-shadows, box-shadow-base);
8+
}
59

610
&:active,
711
&.active {
812
@include btn-active($btn-colors);
13+
@if (map-get($btn-colors, shadow) == true) {
14+
box-shadow: map-get($ui-btn-shadows, box-shadow-active);
15+
}
916
}
1017

1118
&:focus,
@@ -21,6 +28,9 @@
2128
&:disabled,
2229
&.disabled {
2330
@include btn-disabled($btn-colors);
31+
@if (map-get($btn-colors, shadow) == true) {
32+
box-shadow: map-get($ui-btn-shadows, box-shadow-disabled);
33+
}
2434
}
2535
}
2636

scss/variables/z_buttons.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,23 @@
99
}( this, function( chassis ) {
1010

1111
chassis.uiButton = {
12+
"ui-btn-shadows": {
13+
name: "Button Shadow Styles",
14+
value: {
15+
"transition": "box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
16+
"box-shadow-base": "0 2px 5px 0 rgba(0,0,0,.26)",
17+
"box-shadow-active": "0 8px 15px 0 rgba(0,0,0,.2)",
18+
"box-shadow-disabled": "0 0 0 rgba(0,0,0,0)"
19+
}
20+
},
21+
1222
"ui-btn": {
1323
name: "Generic Button Styles",
1424
value: {
1525
"font-weight": 500,
1626
"margin": ".25em",
17-
"text-transform": "uppercase"
27+
"text-transform": "uppercase",
28+
"letter-spacing": "1px"
1829
}
1930
},
2031
"ui-btn-font": {
@@ -26,23 +37,26 @@ chassis.uiButton = {
2637
value: {
2738
"color": "#212121",
2839
"background": "$default",
29-
"border": "transparent"
40+
"border": "transparent",
41+
"shadow": "false"
3042
}
3143
},
3244
"ui-btn-primary": {
3345
name: "Primary Button",
3446
value: {
3547
"color": "#ffffff",
3648
"background": "$primary",
37-
"border": "transparent"
49+
"border": "transparent",
50+
"shadow": "true"
3851
}
3952
},
4053
"ui-btn-success": {
4154
name: "Success Button",
4255
value: {
4356
"color": "#ffffff",
4457
"background": "$success",
45-
"border": "transparent"
58+
"border": "transparent",
59+
"shadow": "true"
4660
}
4761
},
4862

@@ -51,23 +65,26 @@ chassis.uiButton = {
5165
value: {
5266
"color": "#ffffff",
5367
"background": "$info",
54-
"border": "transparent"
68+
"border": "transparent",
69+
"shadow": "true"
5570
}
5671
},
5772
"ui-btn-warning": {
5873
name: "Warning Button",
5974
value: {
6075
"color": "#ffffff",
6176
"background": "$warning",
62-
"border": "transparent"
77+
"border": "transparent",
78+
"shadow": "true"
6379
}
6480
},
6581
"ui-btn-danger": {
6682
name: "Danger Button",
6783
value: {
6884
"color": "#ffffff",
6985
"background": "$error",
70-
"border": "transparent"
86+
"border": "transparent",
87+
"shadow": "true"
7188
}
7289
},
7390
"ui-btn-disabled": {

0 commit comments

Comments
 (0)