Skip to content

Commit 172357a

Browse files
committed
fix tests
1 parent a05f6b2 commit 172357a

22 files changed

+48
-55
lines changed

.stylelintrc.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,23 @@
143143
"resolveNestedSelectors": true
144144
}
145145
]
146-
}
146+
},
147+
"overrides": [
148+
{
149+
"files": [
150+
"**/_card-theme.scss",
151+
"**/_checkbox-theme.scss",
152+
"**/_core-theme.scss",
153+
"**/_form-field-theme.scss",
154+
"**/_optgroup-theme.scss",
155+
"**/_option-theme.scss",
156+
"**/_progress-bar-theme.scss",
157+
"**/_pseudo-checkbox-theme.scss",
158+
"**/_ripple-theme.scss"
159+
],
160+
"rules": {
161+
"material/theme-mixin-api": false
162+
}
163+
}
164+
]
147165
}

src/material/card/_card-theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525
}
2626

27-
@mixin color($theme) {
27+
@mixin color($config-or-theme) {
2828
@if inspection.get-theme-version($theme) == 1 {
2929
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
3030
}
@@ -50,7 +50,7 @@
5050
}
5151
}
5252

53-
@mixin typography($theme) {
53+
@mixin typography($config-or-theme) {
5454
@if inspection.get-theme-version($theme) == 1 {
5555
@include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
5656
}
@@ -69,7 +69,7 @@
6969
}
7070
}
7171

72-
@mixin density($theme) {
72+
@mixin density($config-or-theme) {
7373
@if inspection.get-theme-version($theme) == 1 {
7474
@include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
7575
}

src/material/core/_core-theme.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use 'sass:map';
21
@use './theming/theming';
32
@use './theming/inspection';
43
@use './style/private';
@@ -9,7 +8,7 @@
98
@use './style/elevation';
109
@use './typography/typography';
1110

12-
@mixin color($theme) {
11+
@mixin color($config-or-theme) {
1312
@include ripple-theme.color($theme);
1413
@include option-theme.color($theme);
1514
@include optgroup-theme.color($theme);
@@ -43,15 +42,15 @@
4342
}
4443
}
4544

46-
@mixin typography($theme) {
45+
@mixin typography($config-or-theme) {
4746
@include option-theme.typography($theme);
4847
@include optgroup-theme.typography($theme);
4948
@include pseudo-checkbox-theme.typography($theme);
5049
// TODO(mmalerba): add typography mixin for this.
5150
// @include ripple-theme.typography($config);
5251
}
5352

54-
@mixin density($theme) {
53+
@mixin density($config-or-theme) {
5554
@include option-theme.density($theme);
5655
@include optgroup-theme.density($theme);
5756
// TODO(mmalerba): add density mixins for these.

src/material/core/option/_optgroup-theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
@use '../theming/inspection';
77
@use '../typography/typography';
88

9-
@mixin color($theme) {
9+
@mixin color($config-or-theme) {
1010
@include sass-utils.current-selector-or-root() {
1111
@include token-utils.create-token-values(tokens-mat-optgroup.$prefix,
1212
tokens-mat-optgroup.get-color-tokens($theme));
1313
}
1414
}
1515

16-
@mixin typography($theme) {
16+
@mixin typography($config-or-theme) {
1717
@include sass-utils.current-selector-or-root() {
1818
@include token-utils.create-token-values(tokens-mat-optgroup.$prefix,
1919
tokens-mat-optgroup.get-typography-tokens($theme));
2020
}
2121
}
2222

23-
@mixin density($theme) {
23+
@mixin density($config-or-theme) {
2424
}
2525

2626
@mixin theme($theme-or-color-config) {

src/material/core/option/_option-theme.scss

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
@use 'sass:map';
21
@use '../tokens/m2/mat/option' as tokens-mat-option;
32
@use '../tokens/token-utils';
43
@use '../style/sass-utils';
54

65
@use '../theming/theming';
76
@use '../theming/inspection';
87
@use '../typography/typography';
9-
@use '../mdc-helpers/mdc-helpers';
108

11-
@mixin color($theme) {
9+
@mixin color($config-or-theme) {
1210
@include sass-utils.current-selector-or-root() {
1311
@include token-utils.create-token-values(tokens-mat-option.$prefix,
1412
tokens-mat-option.get-color-tokens($theme));
@@ -25,14 +23,14 @@
2523
}
2624
}
2725

28-
@mixin typography($theme) {
26+
@mixin typography($config-or-theme) {
2927
@include sass-utils.current-selector-or-root() {
3028
@include token-utils.create-token-values(tokens-mat-option.$prefix,
3129
tokens-mat-option.get-typography-tokens($theme));
3230
}
3331
}
3432

35-
@mixin density($theme) {
33+
@mixin density($config-or-theme) {
3634
}
3735

3836
@mixin theme($theme-or-color-config) {

src/material/core/ripple/_ripple-theme.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
@use 'sass:map';
21
@use 'sass:meta';
32
@use '../theming/theming';
43
@use '../theming/inspection';
54

65
// Colors for the ripple elements.
7-
@mixin color($theme) {
6+
@mixin color($config-or-theme) {
87
$foreground-base: inspection.get-theme-color($theme, foreground, base);
98
$color-opacity: 0.1;
109

src/material/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use 'sass:map';
21
@use '../../theming/theming';
32
@use '../../theming/inspection';
43

@@ -20,7 +19,7 @@
2019
}
2120
}
2221

23-
@mixin color($theme) {
22+
@mixin color($config-or-theme) {
2423
$is-dark-theme: inspection.get-theme-type($theme) == dark;
2524
$primary: inspection.get-theme-color($theme, primary);
2625
$accent: inspection.get-theme-color($theme, accent);
@@ -73,7 +72,7 @@
7372
}
7473
}
7574

76-
@mixin typography($theme) {}
75+
@mixin typography($config-or-theme) {}
7776

7877
@mixin _density($theme) {}
7978

src/material/core/theming/_m2-inspection.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
2727
}
2828
$internal: map.get($theme, $_internals, m2-config);
2929
$theme: map.remove($theme, $_internals);
30-
@return if(_is-error-theme($theme), $internal, $theme or $internal);
30+
@return if(_is-error-theme($theme), $internal, $theme);
3131
}
3232

3333
/// Gets the type of theme represented by a theme object (light or dark).
@@ -142,7 +142,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
142142
@return theming.get-typography-config($theme) != null;
143143
}
144144
@if $system == density {
145-
@return theming.get-density-config($theme, $default: null) != null;
145+
@return theming.get-density-config($theme) != null;
146146
}
147147
@error 'Valid systems are: base, color, typography, density. Got:' $system;
148148
}

src/material/core/theming/_theming.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,5 +633,5 @@ $_internals: _mat-theming-internals-do-not-access;
633633
}
634634
@return $value;
635635
}
636-
@return ('ERROR': $message);
636+
@return (ERROR: $message);
637637
}

src/material/core/theming/tests/test-css-variables-theme.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
$output: ();
1111

1212
@each $key, $value in $palette {
13-
@if (meta.type-of($value) == 'map') {
14-
$output: map.merge(($key: _replace-all-values($value, $replacement)), $output);
15-
}
16-
@else {
17-
$output: map.merge(($key: $replacement), $output);
13+
@if $key != _mat-theming-internals-do-not-access {
14+
@if (meta.type-of($value) == 'map') {
15+
$output: map.merge(($key: _replace-all-values($value, $replacement)), $output);
16+
}
17+
@else {
18+
$output: map.merge(($key: $replacement), $output);
19+
}
1820
}
1921
}
2022

0 commit comments

Comments
 (0)