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

Commit 959d332

Browse files
authored
feat(fab): Remove disabled styles (#1198)
BREAKING CHANGE: Removes styles for disabled FABs, as FABs were not designed to be disabled.
1 parent d37057d commit 959d332

File tree

4 files changed

+6
-39
lines changed

4 files changed

+6
-39
lines changed

demos/fab.html

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,29 +139,6 @@
139139
</span>
140140
</button>
141141
</fieldset>
142-
<fieldset disabled>
143-
<legend>Disabled FABs</legend>
144-
<button class="mdc-fab material-icons" aria-label="Favorite">
145-
<span class="mdc-fab__icon">
146-
favorite_border
147-
</span>
148-
</button>
149-
<button class="mdc-fab mdc-fab--mini material-icons" aria-label="Favorite">
150-
<span class="mdc-fab__icon">
151-
favorite_border
152-
</span>
153-
</button>
154-
<button class="mdc-fab mdc-fab--plain material-icons" aria-label="Favorite">
155-
<span class="mdc-fab__icon">
156-
favorite_border
157-
</span>
158-
</button>
159-
<button class="mdc-fab mdc-fab--mini mdc-fab--plain material-icons" aria-label="Favorite">
160-
<span class="mdc-fab__icon">
161-
favorite_border
162-
</span>
163-
</button>
164-
</fieldset>
165142
</section>
166143
</main>
167144
<script src="/assets/material-components-web.js"></script>

packages/mdc-fab/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ You may include this to use them as shown or use any other icon method you wish.
7575
### Absolutely positioned
7676

7777
By default the FAB rests in the page where it sits in the content flow.
78-
Developers must position it as-needed within their applications designs.
78+
Developers must position it as needed within their application's design.
7979

8080
```html
8181
<!--
8282
This will position the FAB in the bottom-right corner.
83-
Modify to fit your designs requirements.
83+
Modify to fit your design's requirements.
8484
-->
8585
<style>
8686
.app-fab--absolute.app-fab--absolute {
@@ -144,6 +144,10 @@ CSS Class | Description
144144
`mdc-fab--mini` | Makes the fab smaller (40 x 40 pixels)
145145
`mdc-fab--plain` | Makes the FAB have a white background
146146

147+
> **NOTE**: No disabled styles are defined for FABs, as they are intended to denote a promoted action, and should not be
148+
> displayed in a disabled state. If there is ever a situation where a FAB should *not* perform an action,
149+
> an explanation should be presented to the user.
150+
147151
### Sass Mixins
148152

149153
#### `mdc-fab-theme($config)`

packages/mdc-fab/_mixins.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@
7878
height: 40px;
7979
}
8080

81-
@mixin mdc-fab--disabled_ {
82-
cursor: default;
83-
pointer-events: none;
84-
}
85-
8681
@mixin mdc-fab-theme($config) {
8782
$bg-color: map-get($config, bg-color);
8883
$fg-color: map-get($config, fg-color);

packages/mdc-fab/mdc-fab.scss

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@
2525
ripple-config: (base-color: white, opacity: .16),
2626
tap-highlight-color: rgba(0, 0, 0, .18)
2727
));
28-
29-
:disabled &,
30-
&:disabled {
31-
@include mdc-fab-theme((
32-
bg-color: rgba(0, 0, 0, .12),
33-
fg-color: rgba(0, 0, 0, .26)
34-
));
35-
@include mdc-fab--disabled_;
36-
}
3728
}
3829

3930
.mdc-fab--plain {

0 commit comments

Comments
 (0)