Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit e6d20fa

Browse files
author
Robert Messerle
committed
refactor(ripple): rewrite of the ripple service using $animateCss and providing more control over the ripples states
adds support for centered ripples adds support for theme colors adds ripple directive, adds support for mdNoInk, adds support for dimBackground, adds support for fitRipple Ripples now respect a minimum timeout value
1 parent 333984f commit e6d20fa

File tree

4 files changed

+256
-362
lines changed

4 files changed

+256
-362
lines changed

src/components/button/button-theme.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
$button-border-radius: 3px !default;
2-
$button-fab-border-radius: 50% !default;
3-
$button-icon-border-radius: $button-fab-border-radius;
4-
51
a.md-button.md-THEME_NAME-theme,
62
.md-button.md-THEME_NAME-theme {
7-
border-radius: $button-border-radius;
83

94
&:not([disabled]) {
105
&:hover {
@@ -19,7 +14,6 @@ a.md-button.md-THEME_NAME-theme,
1914
}
2015

2116
&.md-fab {
22-
border-radius: $button-fab-border-radius;
2317
background-color: '{{accent-color}}';
2418
color: '{{accent-contrast}}';
2519
md-icon {
@@ -35,10 +29,6 @@ a.md-button.md-THEME_NAME-theme,
3529
}
3630
}
3731

38-
&.md-icon-button {
39-
border-radius: $button-icon-border-radius;
40-
}
41-
4232
&.md-primary {
4333
color: '{{primary-color}}';
4434
&.md-raised,
@@ -64,7 +54,6 @@ a.md-button.md-THEME_NAME-theme,
6454
}
6555
}
6656
&.md-fab {
67-
border-radius: $button-fab-border-radius;
6857
background-color: '{{accent-color}}';
6958
color: '{{accent-contrast}}';
7059
&:not([disabled]) {

src/components/button/button.scss

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
$button-border-radius: 3px !default;
2+
$button-fab-border-radius: 50% !default;
3+
$button-icon-border-radius: $button-fab-border-radius;
4+
15
$button-line-height: rem(3.60) !default;
26
$button-padding: 0 rem(0.600) !default;
37
$button-margin: rem(0.600) rem(0.800) !default;
@@ -16,6 +20,7 @@ $icon-button-width: rem(4.800) !default;
1620
$icon-button-margin: rem(0.600) !default;
1721

1822
.md-button {
23+
border-radius: $button-border-radius;
1924
box-sizing: border-box;
2025
color: currentColor;
2126

@@ -92,9 +97,9 @@ $icon-button-margin: rem(0.600) !default;
9297
padding-left: 0;
9398
padding-right: 0;
9499
width: $icon-button-width;
95-
border-radius: 50%;
100+
border-radius: $button-icon-border-radius;
96101
.md-ripple-container {
97-
border-radius: 50%;
102+
border-radius: $button-icon-border-radius;
98103
background-clip: padding-box;
99104
overflow: hidden;
100105
// The following hack causes Safari/Chrome to respect overflow hidden for ripples
@@ -116,14 +121,14 @@ $icon-button-margin: rem(0.600) !default;
116121
vertical-align: middle;
117122

118123
@include md-shadow-bottom-z-1();
119-
border-radius: 50%;
124+
border-radius: $button-fab-border-radius;
120125
background-clip: padding-box;
121126
overflow: hidden;
122127

123128
transition: 0.2s linear;
124129
transition-property: background-color, box-shadow;
125130
.md-ripple-container {
126-
border-radius: 50%;
131+
border-radius: $button-fab-border-radius;
127132
background-clip: padding-box;
128133
overflow: hidden;
129134
// The following hack causes Safari/Chrome to respect overflow hidden for ripples
@@ -149,6 +154,14 @@ $icon-button-margin: rem(0.600) !default;
149154
}
150155
}
151156
}
157+
158+
.md-ripple-container {
159+
border-radius: $button-border-radius;
160+
background-clip: padding-box;
161+
overflow: hidden;
162+
// The following hack causes Safari/Chrome to respect overflow hidden for ripples
163+
-webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC');
164+
}
152165
}
153166

154167
.md-toast-open-top {

0 commit comments

Comments
 (0)