Add HTMLLinkElement.prototype.use
apply shared style in Declarative Shadow DOM
#9962
Labels
addition/proposal
New features or enhancements
needs implementer interest
Moving the issue forward requires implementers to express interest
What problem are you trying to solve?
Shadow DOM use
adoptedStylesheets
apply shared style.Declarative Shadow DOM no corresponding way
What solutions exist today?
Use external style sheet:
How would you solve it?
Use
<link rel="stylesheet" use="">
e.g:On the parser side, the style1 stylesheet will be applied to
document
andmy-element#shadowRoot
, and the style2 stylesheet will be only applied todocument
.Advantage:
DocumnetOrShadowRoot.adoptedStylesheets
Serialization
For manual serialization of
adoptedStylesheets
while traversing the DOM, can control theid
generation method. can also add argument option togetInnerHTML
to specify theid
generation method, e.g:Anything else?
Other solution: let the link element href attribute support fragment-only URLs:
But this conflicts with the SVG use element and CSS: WICG/webcomponents#772 (comment)
The text was updated successfully, but these errors were encountered: