Skip to content

Commit

Permalink
fix: use explicit CSSResult[] types for static styles
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 609494809
  • Loading branch information
asyncLiz authored and copybara-github committed Feb 22, 2024
1 parent 8432bbb commit ce41b7b
Show file tree
Hide file tree
Showing 54 changed files with 171 additions and 67 deletions.
3 changes: 2 additions & 1 deletion button/elevated-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {ElevatedButton} from './internal/elevated-button.js';
Expand Down Expand Up @@ -41,7 +42,7 @@ declare global {
*/
@customElement('md-elevated-button')
export class MdElevatedButton extends ElevatedButton {
static override styles = [
static override styles: CSSResult[] = [
sharedStyles,
sharedElevationStyles,
elevatedStyles,
Expand Down
7 changes: 6 additions & 1 deletion button/filled-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {FilledButton} from './internal/filled-button.js';
Expand Down Expand Up @@ -39,5 +40,9 @@ declare global {
*/
@customElement('md-filled-button')
export class MdFilledButton extends FilledButton {
static override styles = [sharedStyles, sharedElevationStyles, filledStyles];
static override styles: CSSResult[] = [
sharedStyles,
sharedElevationStyles,
filledStyles,
];
}
7 changes: 6 additions & 1 deletion button/filled-tonal-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {FilledTonalButton} from './internal/filled-tonal-button.js';
Expand Down Expand Up @@ -40,5 +41,9 @@ declare global {
*/
@customElement('md-filled-tonal-button')
export class MdFilledTonalButton extends FilledTonalButton {
static override styles = [sharedStyles, sharedElevationStyles, tonalStyles];
static override styles: CSSResult[] = [
sharedStyles,
sharedElevationStyles,
tonalStyles,
];
}
3 changes: 2 additions & 1 deletion button/outlined-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {OutlinedButton} from './internal/outlined-button.js';
Expand Down Expand Up @@ -40,5 +41,5 @@ declare global {
*/
@customElement('md-outlined-button')
export class MdOutlinedButton extends OutlinedButton {
static override styles = [sharedStyles, outlinedStyles];
static override styles: CSSResult[] = [sharedStyles, outlinedStyles];
}
3 changes: 2 additions & 1 deletion button/text-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {styles as sharedStyles} from './internal/shared-styles.css.js';
Expand Down Expand Up @@ -38,5 +39,5 @@ declare global {
*/
@customElement('md-text-button')
export class MdTextButton extends TextButton {
static override styles = [sharedStyles, textStyles];
static override styles: CSSResult[] = [sharedStyles, textStyles];
}
3 changes: 2 additions & 1 deletion checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {Checkbox} from './internal/checkbox.js';
Expand All @@ -30,5 +31,5 @@ declare global {
*/
@customElement('md-checkbox')
export class MdCheckbox extends Checkbox {
static override styles = [styles];
static override styles: CSSResult[] = [styles];
}
3 changes: 2 additions & 1 deletion chips/assist-chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {AssistChip} from './internal/assist-chip.js';
Expand All @@ -25,5 +26,5 @@ declare global {
*/
@customElement('md-assist-chip')
export class MdAssistChip extends AssistChip {
static override styles = [sharedStyles, elevatedStyles, styles];
static override styles: CSSResult[] = [sharedStyles, elevatedStyles, styles];
}
3 changes: 2 additions & 1 deletion chips/chip-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {ChipSet} from './internal/chip-set.js';
Expand All @@ -23,5 +24,5 @@ declare global {
*/
@customElement('md-chip-set')
export class MdChipSet extends ChipSet {
static override styles = [styles];
static override styles: CSSResult[] = [styles];
}
3 changes: 2 additions & 1 deletion chips/filter-chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {styles as elevatedStyles} from './internal/elevated-styles.css.js';
Expand All @@ -27,7 +28,7 @@ declare global {
*/
@customElement('md-filter-chip')
export class MdFilterChip extends FilterChip {
static override styles = [
static override styles: CSSResult[] = [
sharedStyles,
elevatedStyles,
trailingIconStyles,
Expand Down
3 changes: 2 additions & 1 deletion chips/input-chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {InputChip} from './internal/input-chip.js';
Expand All @@ -26,7 +27,7 @@ declare global {
*/
@customElement('md-input-chip')
export class MdInputChip extends InputChip {
static override styles = [
static override styles: CSSResult[] = [
sharedStyles,
trailingIconStyles,
selectableStyles,
Expand Down
3 changes: 2 additions & 1 deletion chips/suggestion-chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {styles as elevatedStyles} from './internal/elevated-styles.css.js';
Expand All @@ -25,5 +26,5 @@ declare global {
*/
@customElement('md-suggestion-chip')
export class MdSuggestionChip extends SuggestionChip {
static override styles = [sharedStyles, elevatedStyles, styles];
static override styles: CSSResult[] = [sharedStyles, elevatedStyles, styles];
}
3 changes: 2 additions & 1 deletion dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {Dialog} from './internal/dialog.js';
Expand Down Expand Up @@ -44,5 +45,5 @@ declare global {
*/
@customElement('md-dialog')
export class MdDialog extends Dialog {
static override styles = [styles];
static override styles: CSSResult[] = [styles];
}
3 changes: 2 additions & 1 deletion divider/divider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {Divider} from './internal/divider.js';
Expand All @@ -27,5 +28,5 @@ declare global {
*/
@customElement('md-divider')
export class MdDivider extends Divider {
static override styles = [styles];
static override styles: CSSResult[] = [styles];
}
6 changes: 5 additions & 1 deletion elevation/elevation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {Elevation} from './internal/elevation.js';
Expand All @@ -19,8 +20,11 @@ declare global {
* The `<md-elevation>` custom element with default styles.
*
* Elevation is the relative distance between two surfaces along the z-axis.
*
* @final
* @suppress {visibility}
*/
@customElement('md-elevation')
export class MdElevation extends Elevation {
static override styles = [styles];
static override styles: CSSResult[] = [styles];
}
3 changes: 2 additions & 1 deletion fab/branded-fab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {Fab, FabVariant} from './internal/fab.js';
Expand Down Expand Up @@ -63,5 +64,5 @@ export class MdBrandedFab extends Fab {
'small': false,
};
}
static override styles = [sharedStyles, styles, forcedColors];
static override styles: CSSResult[] = [sharedStyles, styles, forcedColors];
}
3 changes: 2 additions & 1 deletion fab/fab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {Fab} from './internal/fab.js';
Expand Down Expand Up @@ -49,5 +50,5 @@ declare global {
*/
@customElement('md-fab')
export class MdFab extends Fab {
static override styles = [sharedStyles, styles, forcedColors];
static override styles: CSSResult[] = [sharedStyles, styles, forcedColors];
}
3 changes: 2 additions & 1 deletion field/filled-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {FilledField} from './internal/filled-field.js';
Expand All @@ -23,5 +24,5 @@ declare global {
*/
@customElement('md-filled-field')
export class MdFilledField extends FilledField {
static override styles = [sharedStyles, filledStyles];
static override styles: CSSResult[] = [sharedStyles, filledStyles];
}
3 changes: 2 additions & 1 deletion field/outlined-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {OutlinedField} from './internal/outlined-field.js';
Expand All @@ -23,5 +24,5 @@ declare global {
*/
@customElement('md-outlined-field')
export class MdOutlinedField extends OutlinedField {
static override styles = [sharedStyles, outlinedStyles];
static override styles: CSSResult[] = [sharedStyles, outlinedStyles];
}
3 changes: 2 additions & 1 deletion focus/md-focus-ring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {FocusRing} from './internal/focus-ring.js';
Expand All @@ -23,5 +24,5 @@ declare global {
*/
@customElement('md-focus-ring')
export class MdFocusRing extends FocusRing {
static override styles = [styles];
static override styles: CSSResult[] = [styles];
}
3 changes: 2 additions & 1 deletion icon/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {Icon} from './internal/icon.js';
Expand All @@ -22,5 +23,5 @@ declare global {
@customElement('md-icon')
export class MdIcon extends Icon {
/** @nocollapse */
static override styles = [styles];
static override styles: CSSResult[] = [styles];
}
6 changes: 5 additions & 1 deletion iconbutton/filled-icon-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {styles} from './internal/filled-styles.css.js';
Expand All @@ -30,10 +31,13 @@ declare global {
* __Example usages:__
* - Add to Favorites
* - Print
*
* @final
* @suppress {visibility}
*/
@customElement('md-filled-icon-button')
export class MdFilledIconButton extends IconButton {
static override styles = [sharedStyles, styles];
static override styles: CSSResult[] = [sharedStyles, styles];

protected override getRenderClasses() {
return {
Expand Down
6 changes: 5 additions & 1 deletion iconbutton/filled-tonal-icon-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {styles} from './internal/filled-tonal-styles.css.js';
Expand All @@ -30,10 +31,13 @@ declare global {
* __Example usages:__
* - Add to Favorites
* - Print
*
* @final
* @suppress {visibility}
*/
@customElement('md-filled-tonal-icon-button')
export class MdFilledTonalIconButton extends IconButton {
static override styles = [sharedStyles, styles];
static override styles: CSSResult[] = [sharedStyles, styles];

protected override getRenderClasses() {
return {
Expand Down
6 changes: 5 additions & 1 deletion iconbutton/icon-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResult} from 'lit';
import {customElement} from 'lit/decorators.js';

import {IconButton} from './internal/icon-button.js';
Expand All @@ -30,10 +31,13 @@ declare global {
* __Example usages:__
* - Add to Favorites
* - Print
*
* @final
* @suppress {visibility}
*/
@customElement('md-icon-button')
export class MdIconButton extends IconButton {
static override styles = [sharedStyles, styles];
static override styles: CSSResult[] = [sharedStyles, styles];

protected override getRenderClasses() {
return {
Expand Down
Loading

0 comments on commit ce41b7b

Please sign in to comment.