Skip to content

Commit

Permalink
feat(list): Created a separate style module for icon web component in…
Browse files Browse the repository at this point in the history
… list

PiperOrigin-RevId: 461809487
  • Loading branch information
material-web-copybara authored and copybara-github committed Jul 19, 2022
1 parent 899a4e6 commit e64cdbe
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 31 deletions.
29 changes: 0 additions & 29 deletions list/lib/_list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
.md3-list-item--with-leading-video {
@include video-item-root;
}

.md3-list-item__icon {
@include icon-root;
}
}

@mixin host-root() {
Expand Down Expand Up @@ -109,28 +105,3 @@
padding-inline-start: 0;
}
}

@mixin icon-root() {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: inherit;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
height: 100%;
width: 100%;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
34 changes: 34 additions & 0 deletions list/lib/icon/_list-item-icon.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// Copyright 2022 Google LLC
// SPDX-License-Identifier: Apache-2.0
//

// stylelint-disable selector-class-pattern --
// Selector '.md3-*' should only be used in this project.

@mixin static-styles() {
.md3-list-item__icon {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: inherit;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
height: 100%;
width: 100%;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
}
10 changes: 10 additions & 0 deletions list/lib/icon/list-item-icon-styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Copyright 2022 Google LLC
// SPDX-License-Identifier: Apache-2.0
//

@use './list-item-icon';

:host {
@include list-item-icon.static-styles();
}
File renamed without changes.
4 changes: 2 additions & 2 deletions list/list-item-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import {customElement} from 'lit/decorators';

import {ListItemIcon} from './lib/list-item-icon';
import {styles} from './lib/list-item-styles.css';
import {ListItemIcon} from './lib/icon/list-item-icon';
import {styles} from './lib/icon/list-item-icon-styles.css';

declare global {
interface HTMLElementTagNameMap {
Expand Down

0 comments on commit e64cdbe

Please sign in to comment.