File tree 6 files changed +18
-9
lines changed
site/src/routes/demo/icon-button
6 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 1
1
@use ' @material/feature-targeting/index' as feature-targeting ;
2
2
@use ' @material/icon-button/icon-button-theme' ;
3
3
4
+ $mini-icon-height : 24px !default ;
5
+ $mini-height : 40px !default ;
4
6
$button-icon-height : 18px !default ;
5
7
$button-height : 36px !default ;
6
8
7
9
@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
+
8
15
.mdc-icon-button.smui-icon-button--size-button {
9
16
@include icon-button-theme .icon-size ($button-icon-height );
10
17
@include icon-button-theme .size ($button-height );
Original file line number Diff line number Diff line change 25
25
' mdc-icon-button--touch' : touch ,
26
26
' mdc-icon-button--display-flex' : displayFlex ,
27
27
' smui-icon-button--size-button' : size === ' button' ,
28
+ ' smui-icon-button--size-mini' : size === ' mini' ,
28
29
' mdc-icon-button--reduced-size' : size === ' mini' || size === ' button' ,
29
30
' mdc-card__action' : context === ' card:action' ,
30
31
' mdc-card__action--icon' : context === ' card:action' ,
Original file line number Diff line number Diff line change 6
6
<div style =" display: flex; align-items: center;" >
7
7
<IconButton class ="material-icons" on:click ={() => clicked ++ } disabled
8
8
>search</IconButton
9
- > (disabled)
9
+ > (disabled)
10
10
</div >
11
11
<div style =" display: flex; align-items: center;" >
12
12
<IconButton class ="material-icons" on:click ={() => clicked ++ } ripple ={false }
13
13
>add_shopping_cart</IconButton
14
- > (no ripple)
14
+ > (no ripple)
15
15
</div >
16
16
17
17
<pre class ="status" >Clicked: {clicked }</pre >
Original file line number Diff line number Diff line change 3
3
<Icon component ={Svg } viewBox =" 0 0 24 24" >
4
4
<path fill ="currentColor" d ={mdiWrench } />
5
5
</Icon >
6
- </IconButton > (normal = standard icon button size)
6
+ </IconButton > (normal = standard icon button size)
7
7
</div >
8
8
<div style =" display: flex; align-items: center;" >
9
9
<IconButton class ="material-icons" on:click ={() => clicked ++ } size =" mini" >
10
10
<Icon component ={Svg } viewBox =" 0 0 24 24" >
11
11
<path fill ="currentColor" d ={mdiWrench } />
12
12
</Icon >
13
- </IconButton > (mini = same size as mini FAB)
13
+ </IconButton > (mini = same size as mini FAB)
14
14
</div >
15
15
<div style =" display: flex; align-items: center;" >
16
16
<IconButton class ="material-icons" on:click ={() => clicked ++ } size =" button" >
17
17
<Icon component ={Svg } viewBox =" 0 0 24 24" >
18
18
<path fill ="currentColor" d ={mdiWrench } />
19
19
</Icon >
20
- </IconButton > (button = same height as button)
20
+ </IconButton > (button = same height as button)
21
21
</div >
22
22
23
23
<pre class ="status" >Clicked: {clicked }</pre >
Original file line number Diff line number Diff line change 10
10
<Icon component ={Svg } viewBox =" 0 0 24 24" >
11
11
<path fill ="currentColor" d ={mdiWrench } />
12
12
</Icon >
13
- </IconButton > (disabled)
13
+ </IconButton > (disabled)
14
14
</div >
15
15
<div style =" display: flex; align-items: center;" >
16
16
<IconButton on:click ={() => clicked ++ } ripple ={false }>
17
17
<Icon component ={Svg } viewBox =" 0 0 24 24" >
18
18
<path fill ="currentColor" d ={mdiCurrencyUsd } />
19
19
</Icon >
20
- </IconButton > (no ripple)
20
+ </IconButton > (no ripple)
21
21
</div >
22
22
23
23
<pre class ="status" >Clicked: {clicked }</pre >
Original file line number Diff line number Diff line change 10
10
<Icon class =" material-icons" >alarm_off</Icon >
11
11
</IconButton >
12
12
13
+
14
+
13
15
<!-- Note: this doesn't fire the MDCIconButtonToggle:change event. -->
14
16
<Button on:click ={() => (initialOn = ! initialOn )}>
15
17
<Label >Toggle Programmatically</Label >
24
26
>
25
27
<Icon class =" material-icons" on >bookmark</Icon >
26
28
<Icon class =" material-icons" >bookmark_border</Icon >
27
- </IconButton >
28
- <div >Using events instead of bound variables.</div >
29
+ </IconButton > Using events instead of bound variables.
29
30
</div >
30
31
31
32
<pre class ="status" >Clicked: {toggleClicked }</pre >
You can’t perform that action at this time.
0 commit comments