Skip to content

Commit 1e2374f

Browse files
committed
fix(fab): add box shadow transition for md fab list buttons
This adds the box-shadow, background-color, and color to the transition for Material Design buttons in a fab list, Sass variables for this transition in all modes, it also defaults the md ripple color to the contrast of the fab button color (which by default is primary). Closes #9557
1 parent 5ba09a1 commit 1e2374f

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

src/components/fab/fab.ios.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ $fab-ios-list-button-text-color: color-contrast($colors-ios, $f
2121
/// @prop - Background color of the activated button in a list
2222
$fab-ios-list-button-background-color-activated: color-shade($fab-ios-list-button-background-color) !default;
2323

24+
/// @prop - Transition duration of the transform and opacity of the button in a list
25+
$fab-ios-list-button-transition-duration: 200ms !default;
26+
27+
/// @prop - Speed curve of the transition of the transform and opacity of the button in a list
28+
$fab-ios-list-button-transition-timing-function: ease !default;
29+
30+
/// @prop - Transition delay of the transform and opacity of the button in a list
31+
$fab-ios-list-button-transition-delay: 10ms !default;
32+
2433

2534
.fab-ios {
2635
color: $fab-ios-text-color;
@@ -34,6 +43,9 @@ $fab-ios-list-button-background-color-activated: color-shade($fab-ios-list-butt
3443
.fab-ios-in-list {
3544
color: $fab-ios-list-button-text-color;
3645
background-color: $fab-ios-list-button-background-color;
46+
47+
transition: transform $fab-ios-list-button-transition-duration $fab-ios-list-button-transition-timing-function $fab-ios-list-button-transition-delay,
48+
opacity $fab-ios-list-button-transition-duration $fab-ios-list-button-transition-timing-function $fab-ios-list-button-transition-delay;
3749
}
3850

3951
.fab-ios-in-list.activated {

src/components/fab/fab.md.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ $fab-md-list-button-text-color: color-contrast($colors-md, $fa
2727
/// @prop - Background color of the activated button in a list
2828
$fab-md-list-button-background-color-activated: color-shade($fab-md-list-button-background-color) !default;
2929

30+
/// @prop - Transition duration of the transform and opacity of the button in a list
31+
$fab-md-list-button-transition-duration: 200ms !default;
32+
33+
/// @prop - Speed curve of the transition of the transform and opacity of the button in a list
34+
$fab-md-list-button-transition-timing-function: ease !default;
35+
36+
/// @prop - Transition delay of the transform and opacity of the button in a list
37+
$fab-md-list-button-transition-delay: 10ms !default;
38+
3039

3140
.fab-md {
3241
color: $fab-md-text-color;
@@ -47,12 +56,25 @@ $fab-md-list-button-background-color-activated: color-shade($fab-md-list-butto
4756
.fab-md-in-list {
4857
color: $fab-md-list-button-text-color;
4958
background-color: $fab-md-list-button-background-color;
59+
60+
transition: transform $fab-md-list-button-transition-duration $fab-md-list-button-transition-timing-function $fab-md-list-button-transition-delay,
61+
opacity $fab-md-list-button-transition-duration $fab-md-list-button-transition-timing-function $fab-md-list-button-transition-delay,
62+
box-shadow $button-md-transition-duration $button-md-transition-timing-function,
63+
background-color $button-md-transition-duration $button-md-transition-timing-function,
64+
color $button-md-transition-duration $button-md-transition-timing-function;
5065
}
5166

5267
.fab-md-in-list.activated {
5368
background-color: $fab-md-list-button-background-color-activated;
5469
}
5570

71+
// Material Design FAB Ripple
72+
// --------------------------------------------------
73+
74+
.fab-md .button-effect {
75+
background-color: color-contrast($colors-md, $fab-md-background-color);
76+
}
77+
5678

5779
// Generate MD FAB colors
5880
// --------------------------------------------------

src/components/fab/fab.scss

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ ion-fab-list {
132132
min-height: $fab-size;
133133
}
134134

135-
ion-fab-list .fab-in-list {
135+
.fab-in-list {
136136
margin: 8px 0;
137137

138138
width: $fab-mini-size;
@@ -141,12 +141,9 @@ ion-fab-list .fab-in-list {
141141
opacity: 0;
142142
visibility: hidden;
143143
transform: scale(0);
144-
transition: all 200ms ease;
145-
transition-delay: 10ms;
146-
transition-property: transform, opacity;
147144
}
148145

149-
ion-fab-list .fab-in-list.show {
146+
.fab-in-list.show {
150147
opacity: 1;
151148
visibility: visible;
152149
transform: scale(1);

src/components/fab/fab.wp.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ $fab-wp-list-button-text-color: color-contrast($colors-wp, $fa
2121
/// @prop - Background color of the activated button in a list
2222
$fab-wp-list-button-background-color-activated: color-shade($fab-wp-list-button-background-color) !default;
2323

24+
/// @prop - Transition duration of the transform and opacity of the button in a list
25+
$fab-wp-list-button-transition-duration: 200ms !default;
26+
27+
/// @prop - Speed curve of the transition of the transform and opacity of the button in a list
28+
$fab-wp-list-button-transition-timing-function: ease !default;
29+
30+
/// @prop - Transition delay of the transform and opacity of the button in a list
31+
$fab-wp-list-button-transition-delay: 10ms !default;
32+
2433

2534
.fab-wp {
2635
color: $fab-wp-text-color;
@@ -34,6 +43,9 @@ $fab-wp-list-button-background-color-activated: color-shade($fab-wp-list-butto
3443
.fab-wp-in-list {
3544
color: $fab-wp-list-button-text-color;
3645
background-color: $fab-wp-list-button-background-color;
46+
47+
transition: transform $fab-wp-list-button-transition-duration $fab-wp-list-button-transition-timing-function $fab-wp-list-button-transition-delay,
48+
opacity $fab-wp-list-button-transition-duration $fab-wp-list-button-transition-timing-function $fab-wp-list-button-transition-delay;
3749
}
3850

3951
.fab-wp-in-list.activated {

0 commit comments

Comments
 (0)