Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 245f9f7

Browse files
committed
Fix margin around mini FAB without touch target.
1 parent 7a4c866 commit 245f9f7

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

packages/mdc-fab/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ While the FAB is 48x48px by default, the mini FAB is 40x40px. Add the following
150150

151151
```html
152152
<div class="mdc-touch-target-wrapper">
153-
<button class="mdc-fab mdc-fab--mini">
153+
<button class="mdc-fab mdc-fab--mini mdc-fab--touch">
154154
<div class="mdc-fab__ripple"></div>
155155
<span class="material-icons mdc-fab__icon">add</span>
156156
<span class="mdc-fab__label">Create</span>

packages/mdc-fab/_mixins.scss

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,10 @@ $mdc-fab-ripple-target: ".mdc-fab__ripple";
5555

5656
.mdc-fab--mini {
5757
@include mdc-fab--mini_($query: $query);
58-
@include mdc-touch-target-component(
59-
$component-height: $mdc-fab-mini-height,
60-
$component-width: $mdc-fab-mini-height,
61-
$query: $query);
58+
}
6259

63-
.mdc-fab__touch {
64-
@include mdc-touch-target($set-width: true, $query: $query);
65-
}
60+
.mdc-fab--touch {
61+
@include mdc-fab--touch_($query: $query);
6662
}
6763

6864
.mdc-fab--extended {
@@ -316,6 +312,17 @@ $mdc-fab-icon-enter-duration_: 180ms;
316312
}
317313
}
318314

315+
@mixin mdc-fab--touch_($query: mdc-feature-all()) {
316+
@include mdc-touch-target-component(
317+
$component-height: $mdc-fab-mini-height,
318+
$component-width: $mdc-fab-mini-height,
319+
$query: $query);
320+
321+
.mdc-fab__touch {
322+
@include mdc-touch-target($set-width: true, $query: $query);
323+
}
324+
}
325+
319326
@mixin mdc-fab--extended_($query: mdc-feature-all()) {
320327
@include mdc-typography(button, $query: $query);
321328
@include mdc-fab-extended-shape-radius(50%, $query: $query);

0 commit comments

Comments
 (0)