Skip to content

Commit 1163b1e

Browse files
zelliottmmalerba
authored andcommitted
Minor Sass changes.
1 parent b267d15 commit 1163b1e

File tree

2 files changed

+46
-57
lines changed

2 files changed

+46
-57
lines changed

src/dev-app/dev-app/dev-app-layout.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,9 @@ export class DevAppLayout {
112112
this.dark = !this.dark;
113113

114114
if (this.dark) {
115-
this._element.nativeElement.classList.add(darkThemeClass);
116-
this._overlayContainer.getContainerElement().classList.add(darkThemeClass);
115+
document.body.classList.add(darkThemeClass);
117116
} else {
118-
this._element.nativeElement.classList.remove(darkThemeClass);
119-
this._overlayContainer.getContainerElement().classList.remove(darkThemeClass);
117+
document.body.classList.remove(darkThemeClass);
120118
}
121119
}
122120

@@ -126,11 +124,9 @@ export class DevAppLayout {
126124
this.strongFocus = !this.strongFocus;
127125

128126
if (this.strongFocus) {
129-
this._element.nativeElement.classList.add(strongFocusClass);
130-
this._overlayContainer.getContainerElement().classList.add(strongFocusClass);
127+
document.body.classList.add(strongFocusClass);
131128
} else {
132-
this._element.nativeElement.classList.remove(strongFocusClass);
133-
this._overlayContainer.getContainerElement().classList.remove(strongFocusClass);
129+
document.body.classList.remove(strongFocusClass);
134130
}
135131
}
136132
}

src/material/core/focus-indicator/_focus-indicator.scss

Lines changed: 42 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,60 @@
66
/// .my-app {
77
/// @include mat-strong-focus-indicators();
88
/// }
9-
109
@mixin mat-strong-focus-indicators() {
11-
// Reference to the root selector, used to simplify the nested selectors
12-
// in this mixin.
13-
$root-selector: #{&};
14-
1510
// Border width of the focus indicators.
1611
$border-width: 2px;
1712

18-
@at-root .mat-focus-indicator {
19-
// Base styles for the focus indicators.
20-
#{$root-selector} &::before {
21-
border: $border-width solid transparent;
22-
border-radius: 4px;
23-
box-sizing: border-box;
24-
pointer-events: none;
25-
position: absolute;
26-
top: 0;
27-
right: 0;
28-
bottom: 0;
29-
left: 0;
30-
}
13+
// Base styles for the focus indicators.
14+
.mat-focus-indicator::before {
15+
border-radius: 4px;
16+
border: $border-width solid transparent;
17+
box-sizing: border-box;
18+
position: absolute;
19+
pointer-events: none;
20+
top: 0;
21+
right: 0;
22+
bottom: 0;
23+
left: 0;
24+
}
3125

32-
// By default, all focus indicators are flush with the bounding box of their
33-
// host element. For particular elements (listed below), default inset/offset
34-
// values are necessary to ensure that the focus indicator is sufficiently
35-
// contrastive and renders appropriately.
26+
// By default, all focus indicators are flush with the bounding box of their
27+
// host element. For particular elements (listed below), default inset/offset
28+
// values are necessary to ensure that the focus indicator is sufficiently
29+
// contrastive and renders appropriately.
3630

37-
#{$root-selector} &.mat-button-base::before,
38-
#{$root-selector} &.mat-card::before,
39-
#{$root-selector} &.mat-sort-header-button::before {
40-
margin: $border-width * -2;
41-
}
31+
.mat-focus-indicator.mat-button-base::before,
32+
.mat-focus-indicator.mat-button-base::before,
33+
.mat-focus-indicator.mat-card::before,
34+
.mat-focus-indicator.mat-sort-header-button::before {
35+
margin: $border-width * -2;
36+
}
4237

43-
#{$root-selector} &.mat-calendar-body-cell::before {
44-
margin: $border-width * -1;
45-
}
38+
.mat-focus-indicator.mat-calendar-body-cell::before {
39+
margin: $border-width * -1;
40+
}
4641

47-
#{$root-selector} &.mat-tab-link::before,
48-
#{$root-selector} &.mat-tab-label::before {
49-
margin: $border-width * 2;
50-
}
42+
.mat-focus-indicator.mat-tab-link::before,
43+
.mat-focus-indicator.mat-tab-label::before {
44+
margin: $border-width * 2;
45+
}
5146

52-
// Render the focus indicator on focus. Defining a pseudo element's
53-
// content will cause it to render.
47+
// Render the focus indicator on focus. Defining a pseudo element's
48+
// content will cause it to render.
5449

55-
// For checkboxes, radios, and slide toggles, render the focus indicator
56-
// when the class .cdk-focused is present.
57-
#{$root-selector} .cdk-focused.mat-checkbox &::before,
58-
#{$root-selector} .cdk-focused.mat-radio-button &::before,
59-
#{$root-selector} .cdk-focused.mat-slide-toggle &::before,
50+
// For checkboxes, radios, and slide toggles, render the focus indicator
51+
// when the class .cdk-focused is present.
52+
.cdk-focused.mat-checkbox .mat-focus-indicator::before,
53+
.cdk-focused.mat-radio-button .mat-focus-indicator::before,
54+
.cdk-focused.mat-slide-toggle .mat-focus-indicator::before,
6055

61-
// For options, render the focus indicator when the class .mat-active
62-
// is present.
63-
#{$root-selector} &.mat-active.mat-option::before,
56+
// For options, render the focus indicator when the class .mat-active
57+
// is present.
58+
.mat-focus-indicator.mat-option.mat-active::before,
6459

65-
// For all other components, render the focus indicator on focus.
66-
#{$root-selector} &:focus::before {
67-
content: '';
68-
}
60+
// For all other components, render the focus indicator on focus.
61+
.mat-focus-indicator:focus::before {
62+
content: '';
6963
}
7064
}
7165

@@ -84,7 +78,6 @@
8478
/// .demo-red-theme {
8579
/// @include mat-strong-focus-indicators-theme(#F00);
8680
/// }
87-
8881
@mixin mat-strong-focus-indicators-theme($themeOrColor) {
8982
.mat-focus-indicator::before {
9083
border-color: if(

0 commit comments

Comments
 (0)