You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Abstract: This specification defines the ''::part()'' and ''::theme()'' pseudo-elements on <a>shadow hosts</a>, allowing <a>shadow hosts</a> to selectively expose chosen elements from their <a>shadow tree</a> to the outside page for styling purposes.
11
+
Abstract: This specification defines the ''::part()'' pseudo-element on <a>shadow hosts</a>, allowing <a>shadow hosts</a> to selectively expose chosen elements from their <a>shadow tree</a> to the outside page for styling purposes.
12
12
</pre>
13
13
14
14
<pre class=link-defaults>
@@ -32,8 +32,8 @@ accidentally over-applying and making a different part of the page look wrong.
32
32
However, this styling barrier also makes it harder for a page to interact with its components
33
33
when it actually <em>wants</em> to do so.
34
34
35
-
This specification defines the ''::part()''and ''::theme()''pseudo-elements,
36
-
which allow an author to style specific, purposely exposed elements in a <a>shadow tree</a>
35
+
This specification defines the ''::part()'' pseudo-element,
36
+
which allows an author to style specific, purposely exposed elements in a <a>shadow tree</a>
37
37
from the outside page's context.
38
38
In combination with <a>custom properties</a>,
39
39
which let the outside page pass particular values
@@ -95,25 +95,14 @@ and component users,
95
95
should have much better performance,
96
96
and allows for better encapsulation/API surface.
97
97
98
-
Another interesting facet of using <a>custom properties</a>,
99
-
however,
100
-
is that inheritance doesn't stop at the first shadow tree.
101
-
Unless explicitly blocked,
102
-
a <a>custom property</a> inherits down thru nested trees,
103
-
allowing authors to style deeply nested components
104
-
as easily as they style directly-visible ones.
105
-
The same considerations apply to this case,
106
-
so we introduce ''::theme()'' to handle this.
107
-
108
-
It's important to note that ''::part()'' and ''::theme()''
109
-
offer <em>absolutely zero new theoretical power</em>.
110
-
They are not a rehash of the ''>>>'' combinator,
111
-
they're simply a more convenient and consistent syntax
98
+
It's important to note that ''::part()''
99
+
offers <em>absolutely zero new theoretical power</em>.
100
+
It is not a rehash of the ''>>>'' combinator,
101
+
it is simply a more convenient and consistent syntax
112
102
for something authors can already do with <a>custom properties</a>.
113
103
By separating out the explicitly "published" parts of an element
114
-
(the <a>shadow part map</a>)
115
-
from the sub-parts that it merely happens to contain
116
-
(the <a>computed shadow theme map</a>),
104
+
(the <a>shadow part map</a>
105
+
from the sub-parts that it merely happens to contain,
117
106
it also helps with encapsulation,
118
107
as authors can use ''::part()'' without fear of accidental over-styling.
119
108
@@ -259,45 +248,15 @@ Consider a mechanism to exclude sub-parts without forwarding them.
259
248
</script>
260
249
</pre>
261
250
262
-
Exposing More Widely: the <{html-global/theme}> attribute {#theme-attr}
0 commit comments