File tree Expand file tree Collapse file tree 3 files changed +48
-1
lines changed
Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 1+ //
2+ // Copyright 2022 Google LLC
3+ // SPDX-License-Identifier: Apache-2.0
4+ //
5+
6+ @forward ' ./lib/filled-icon-button-theme' show
7+ theme ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright 2022 Google LLC
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ import '../icon/icon.js' ;
8+
9+ import { html , TemplateResult } from 'lit' ;
10+ import { customElement } from 'lit/decorators.js' ;
11+ import { ClassInfo } from 'lit/directives/class-map.js' ;
12+
13+ import { styles } from './lib/filled-styles.css.js' ;
14+ import { LinkIconButton } from './lib/link-icon-button.js' ;
15+ import { styles as sharedStyles } from './lib/icon-button-styles.css.js' ;
16+
17+ declare global {
18+ interface HTMLElementTagNameMap {
19+ 'md-filled-link-icon-button' : MdFilledLinkIconButton ;
20+ }
21+ }
22+
23+ @customElement ( 'md-filled-link-icon-button' )
24+ export class MdFilledLinkIconButton extends LinkIconButton {
25+ static override styles = [ sharedStyles , styles ] ;
26+
27+ /** @soyTemplate */
28+ protected override renderIcon ( icon : string ) : TemplateResult | string {
29+ return icon ? html `< md-icon > ${ icon } </ md-icon > ` : '' ;
30+ }
31+
32+ /** @soyTemplate */
33+ protected override getRenderClasses ( ) : ClassInfo {
34+ return {
35+ ...super . getRenderClasses ( ) ,
36+ 'md3-icon-button--filled' : true ,
37+ } ;
38+ }
39+ }
Original file line number Diff line number Diff line change 66
77import { html , TemplateResult } from 'lit' ;
88import { property } from 'lit/decorators.js' ;
9+ import { classMap } from 'lit/directives/class-map.js' ;
910import { ifDefined } from 'lit/directives/if-defined.js' ;
1011
1112import { IconButton } from './icon-button.js' ;
@@ -25,7 +26,7 @@ export class LinkIconButton extends IconButton {
2526 /** @soyTemplate */
2627 protected override render ( ) : TemplateResult {
2728 return html `< div
28- class ="md3-icon-button "
29+ class ="md3-icon-button ${ classMap ( this . getRenderClasses ( ) ) } "
2930 @focus ="${ this . handleFocus } "
3031 @blur ="${ this . handleBlur } "
3132 @pointerdown ="${ this . handlePointerDown } "
You can’t perform that action at this time.
0 commit comments