Skip to content

Commit 9dc65de

Browse files
committed
fix: icon button mini size
1 parent e37eb98 commit 9dc65de

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

packages/icon-button/_mixins.scss

+7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
@use '@material/feature-targeting/index' as feature-targeting;
22
@use '@material/icon-button/icon-button-theme';
33

4+
$mini-icon-height: 24px !default;
5+
$mini-height: 40px !default;
46
$button-icon-height: 18px !default;
57
$button-height: 36px !default;
68

79
@mixin core-styles($query: feature-targeting.all()) {
10+
.mdc-icon-button.smui-icon-button--size-mini {
11+
@include icon-button-theme.icon-size($mini-icon-height);
12+
@include icon-button-theme.size($mini-height);
13+
}
14+
815
.mdc-icon-button.smui-icon-button--size-button {
916
@include icon-button-theme.icon-size($button-icon-height);
1017
@include icon-button-theme.size($button-height);

packages/icon-button/src/IconButton.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'mdc-icon-button--touch': touch,
2626
'mdc-icon-button--display-flex': displayFlex,
2727
'smui-icon-button--size-button': size === 'button',
28+
'smui-icon-button--size-mini': size === 'mini',
2829
'mdc-icon-button--reduced-size': size === 'mini' || size === 'button',
2930
'mdc-card__action': context === 'card:action',
3031
'mdc-card__action--icon': context === 'card:action',

packages/site/src/routes/demo/icon-button/_Simple.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
<div style="display: flex; align-items: center;">
77
<IconButton class="material-icons" on:click={() => clicked++} disabled
88
>search</IconButton
9-
> (disabled)
9+
>&nbsp;(disabled)
1010
</div>
1111
<div style="display: flex; align-items: center;">
1212
<IconButton class="material-icons" on:click={() => clicked++} ripple={false}
1313
>add_shopping_cart</IconButton
14-
> (no ripple)
14+
>&nbsp;(no ripple)
1515
</div>
1616

1717
<pre class="status">Clicked: {clicked}</pre>

packages/site/src/routes/demo/icon-button/_Sizes.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
<Icon component={Svg} viewBox="0 0 24 24">
44
<path fill="currentColor" d={mdiWrench} />
55
</Icon>
6-
</IconButton> (normal = standard icon button size)
6+
</IconButton>&nbsp;(normal = standard icon button size)
77
</div>
88
<div style="display: flex; align-items: center;">
99
<IconButton class="material-icons" on:click={() => clicked++} size="mini">
1010
<Icon component={Svg} viewBox="0 0 24 24">
1111
<path fill="currentColor" d={mdiWrench} />
1212
</Icon>
13-
</IconButton> (mini = same size as mini FAB)
13+
</IconButton>&nbsp;(mini = same size as mini FAB)
1414
</div>
1515
<div style="display: flex; align-items: center;">
1616
<IconButton class="material-icons" on:click={() => clicked++} size="button">
1717
<Icon component={Svg} viewBox="0 0 24 24">
1818
<path fill="currentColor" d={mdiWrench} />
1919
</Icon>
20-
</IconButton> (button = same height as button)
20+
</IconButton>&nbsp;(button = same height as button)
2121
</div>
2222

2323
<pre class="status">Clicked: {clicked}</pre>

packages/site/src/routes/demo/icon-button/_Svgs.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
<Icon component={Svg} viewBox="0 0 24 24">
1111
<path fill="currentColor" d={mdiWrench} />
1212
</Icon>
13-
</IconButton> (disabled)
13+
</IconButton>&nbsp;(disabled)
1414
</div>
1515
<div style="display: flex; align-items: center;">
1616
<IconButton on:click={() => clicked++} ripple={false}>
1717
<Icon component={Svg} viewBox="0 0 24 24">
1818
<path fill="currentColor" d={mdiCurrencyUsd} />
1919
</Icon>
20-
</IconButton> (no ripple)
20+
</IconButton>&nbsp;(no ripple)
2121
</div>
2222

2323
<pre class="status">Clicked: {clicked}</pre>

packages/site/src/routes/demo/icon-button/_Toggle.svelte

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<Icon class="material-icons">alarm_off</Icon>
1111
</IconButton>
1212

13+
&nbsp;
14+
1315
<!-- Note: this doesn't fire the MDCIconButtonToggle:change event. -->
1416
<Button on:click={() => (initialOn = !initialOn)}>
1517
<Label>Toggle Programmatically</Label>
@@ -24,8 +26,7 @@
2426
>
2527
<Icon class="material-icons" on>bookmark</Icon>
2628
<Icon class="material-icons">bookmark_border</Icon>
27-
</IconButton>
28-
<div>Using events instead of bound variables.</div>
29+
</IconButton>&nbsp;Using events instead of bound variables.
2930
</div>
3031

3132
<pre class="status">Clicked: {toggleClicked}</pre>

0 commit comments

Comments
 (0)