Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit a32fa24

Browse files
authored
refactor(list): expose evolution base mixins
In Angular Material we have several components that are based on simple, single-line lists. Currently if we were to go through the `without-ripple` mixin, we would end up with a lot of unused styles, because all we care about are the base structural styles, colors and typography. These changes make the `list-base` and `item-base` mixins public so that we have more granular control over the included styles.
1 parent cc15b5d commit a32fa24

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/mdc-list/_evolution-mixins.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
@include _high-contrast-mode($query);
3939

4040
.mdc-list {
41-
@include _list-base($query: $query);
41+
@include list-base($query: $query);
4242
}
4343

4444
.mdc-list-item {
45-
@include _item-base($query: $query);
45+
@include item-base($query: $query);
4646
@include item-spacing(16px, $query: $query);
4747

4848
@include _one-line-item-density(
@@ -93,7 +93,7 @@
9393

9494
// For components using aria-activedescendant, the focus pseudoclass is
9595
// never applied and use `.mdc-ripple-upgraded--background-focused` instead.
96-
&:not(.mdc-list-item--selected):focus::before, // lint-disable-focus-psuedo-selector
96+
&:not(.mdc-list-item--selected):focus::before, // lint-disable-focus-pseudo-selector
9797
&.mdc-ripple-upgraded--background-focused::before {
9898
@include dom-mixins.transparent-border($query: $query);
9999
}
@@ -998,7 +998,7 @@
998998
@include three-line-item-height($height, $query: $query);
999999
}
10001000

1001-
@mixin _list-base($query: feature-targeting.all()) {
1001+
@mixin list-base($query: feature-targeting.all()) {
10021002
$feat-color: feature-targeting.create-target($query, color);
10031003
$feat-structure: feature-targeting.create-target($query, structure);
10041004
$feat-typography: feature-targeting.create-target($query, typography);
@@ -1015,14 +1015,14 @@
10151015
padding: 8px 0;
10161016
list-style-type: none;
10171017

1018-
&:focus // lint-disable-focus-psuedo-selector
1018+
&:focus // lint-disable-focus-pseudo-selector
10191019
{
10201020
outline: none;
10211021
}
10221022
}
10231023
}
10241024

1025-
@mixin _item-base($query: feature-targeting.all()) {
1025+
@mixin item-base($query: feature-targeting.all()) {
10261026
$feat-structure: feature-targeting.create-target($query, structure);
10271027
@include feature-targeting.targets($feat-structure) {
10281028
display: flex;
@@ -1032,7 +1032,7 @@
10321032
overflow: hidden;
10331033
padding: 0;
10341034

1035-
&:focus // lint-disable-focus-psuedo-selector
1035+
&:focus // lint-disable-focus-pseudo-selector
10361036
{
10371037
outline: none;
10381038
}

0 commit comments

Comments
 (0)