File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 12
12
$warn : map .get ($config , warn );
13
13
$foreground : map .get ($config , foreground );
14
14
15
- .mat-mdc-checkbox {
15
+ @at-root #{& or body} {
16
16
@include mdc-checkbox-theme .theme (tokens-mdc-checkbox .get-color-tokens ($config ));
17
+ }
17
18
19
+ .mat-mdc-checkbox {
18
20
& .mat-primary {
19
21
$primary-config : map .merge ($config , (accent: $primary ));
20
22
@include mdc-checkbox-theme .theme (tokens-mdc-checkbox .get-color-tokens ($primary-config ));
40
42
@mixin typography ($config-or-theme ) {
41
43
$config : typography .private-typography-to-2018-config (
42
44
theming .get-typography-config ($config-or-theme ));
43
- .mat-mdc-checkbox {
45
+
46
+ @at-root #{& or body} {
44
47
@include mdc-checkbox-theme .theme (tokens-mdc-checkbox .get-typography-tokens ($config ));
48
+ }
45
49
50
+ .mat-mdc-checkbox {
46
51
@include mdc-helpers .using-mdc-typography ($config ) {
47
52
// TODO(mmalerba): Switch to static-styles, theme-styles, and theme once they're available.
48
53
@include mdc-form-field .core-styles ($query : mdc-helpers .$mdc-typography-styles-query );
53
58
@mixin density ($config-or-theme ) {
54
59
$density-scale : theming .get-density-config ($config-or-theme );
55
60
56
- .mat-mdc-checkbox {
61
+ @at-root #{& or body} {
57
62
@include mdc-checkbox-theme .theme (tokens-mdc-checkbox .get-density-tokens ($density-scale ));
58
63
}
59
64
Original file line number Diff line number Diff line change 142
142
}
143
143
}
144
144
145
- .mat-mdc-checkbox {
145
+ body {
146
146
// Add default values for MDC checkbox tokens that aren't outputted by the theming API.
147
147
@include mdc-checkbox-theme .theme (tokens-mdc-checkbox .get-unthemable-tokens ());
148
148
}
Original file line number Diff line number Diff line change @@ -210,9 +210,15 @@ describe('theming api', () => {
210
210
return ;
211
211
}
212
212
node . selectors . forEach ( selector => {
213
- // Only check selectors that match the specified base selector.
214
- if ( baseSelector && ! baseSelectorRegex . test ( selector ) ) {
215
- return ;
213
+ if ( baseSelector && selector === baseSelector ) {
214
+ // Styles emitted directly to the baseSelector are emitted to body
215
+ // when there is no baseSelector.
216
+ selector = 'body' ;
217
+ } else {
218
+ // Only check selectors that match the specified base selector.
219
+ if ( baseSelector && ! baseSelectorRegex . test ( selector ) ) {
220
+ return ;
221
+ }
216
222
}
217
223
selector = selector . replace ( baseSelectorRegex , '' ) ;
218
224
const matchingRule = knownDensitySelectors . get ( selector ) ;
You can’t perform that action at this time.
0 commit comments