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

Commit 7a4c866

Browse files
committed
Add README.
1 parent 14ed93e commit 7a4c866

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

packages/mdc-fab/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,24 @@ In browsers that fully support CSS custom properties, the above mixins will work
143143

144144
### Additional Information
145145

146+
#### Accessibility
147+
148+
Material Design spec advises that touch targets should be at least 48x48px.
149+
While the FAB is 48x48px by default, the mini FAB is 40x40px. Add the following to meet this requirement for mini FAB's:
150+
151+
```html
152+
<div class="mdc-touch-target-wrapper">
153+
<button class="mdc-fab mdc-fab--mini">
154+
<div class="mdc-fab__ripple"></div>
155+
<span class="material-icons mdc-fab__icon">add</span>
156+
<span class="mdc-fab__label">Create</span>
157+
<div class="mdc-fab__touch"></div>
158+
</button>
159+
</div>
160+
```
161+
162+
Note that the outer `mdc-touch-target-wrapper` element is only necessary if you want to avoid potentially overlapping touch targets on adjacent elements (due to collapsing margins).
163+
146164
#### Positioning
147165

148166
Developers must position MDC FAB as needed within their application's design.

packages/mdc-touch-target/_mixins.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
@if $set-width {
6161
@include mdc-feature-targets($feat-structure) {
6262
left: 50%;
63-
transform: translate(-50%, -50%);
6463
width: $mdc-touch-target-width;
64+
transform: translate(-50%, -50%);
6565
}
6666
} @else {
6767
@include mdc-feature-targets($feat-structure) {

0 commit comments

Comments
 (0)