Skip to content

Commit 60f8632

Browse files
committed
Support web components/shadow DOM.
Add :host to all uses of :root
1 parent 6dc6489 commit 60f8632

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

scss/colors/utilities/_css-vars.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$css-var-color-prefix: #{settings.$css-var-prefix}#{$color-property-name};
1010

1111
@if $enable-css-vars {
12-
:root {
12+
:root, :host {
1313
// Loop through color families
1414
@each $family, $colors in colors.$colors {
1515
@if index(map.get(settings.$palette, "color-families"), $family) {

scss/components/_modal.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Modal (<dialog>)
77
*/
88

9-
:root {
9+
:root, :host {
1010
#{$css-var-prefix}scrollbar-width: 0px;
1111
}
1212

scss/content/_embedded.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
}
4848

4949
// Hide the overflow in IE
50-
#{$parent-selector} svg:not(:root) {
51-
overflow: hidden;
50+
#{$parent-selector} svg:not(:root),
51+
#{$parent-selector} svg:not(:host) {
52+
overflow: hidden;
5253
}
5354
}

scss/layout/_document.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// 3. Use a 4-space tab width in all browsers (opinionated)
3535
// 4. Remove the grey highlight on links in iOS (opinionated)
3636
// 5. Prevent adjustments of font size after orientation changes in iOS
37-
:where(:root) {
37+
:where(:root), :where(:host) {
3838
-webkit-tap-highlight-color: transparent; // 4
3939
-webkit-text-size-adjust: 100%; // 5
4040
text-size-adjust: 100%; // 5

scss/themes/default/_schemes.scss

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@
1212
// Light color scheme (Default)
1313
// Can be forced with data-theme="light"
1414
[data-theme="light"],
15-
:root:not([data-theme="dark"]) {
15+
:root:not([data-theme="dark"]),
16+
:host:not([data-theme="dark"]) {
1617
@include light.theme;
1718
}
1819

1920
// Dark color scheme (Auto)
2021
// Automatically enabled if user has Dark mode enabled
2122
@media only screen and (prefers-color-scheme: dark) {
22-
:root:not([data-theme]) {
23-
@include dark.theme;
23+
:root:not([data-theme]),
24+
:host:not([data-theme]) {
25+
@include dark.theme;
2426
}
2527
}
2628

scss/themes/default/_styles.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Styles
1010
*/
1111

12-
:root {
12+
:root, :host {
1313
// Typography
1414
#{$css-var-prefix}font-family-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
1515
"Noto Color Emoji";

0 commit comments

Comments
 (0)