Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DSD style sharing explainer #875

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ShadowDOM/explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ This document explores several proposals that would allow developers to apply st
## Non-goals
Some developers have expressed interest in CSS selectors crossing through the Shadow DOM, as discussed in [issue 909](https://github.com/WICG/webcomponents/issues/909#issuecomment-1977487651). While this scenario is related to sharing styles with Shadow DOM elements, it is solving a different problem and should be addressed separately.

## Use case
## Use case
### Pages with sub-sections

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should update the example to something similar to what is seen in the wild. Potentially a fake page with a table of contents section on the right or left?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an additional sentence like this will suffice, what do you think? "This pattern of pages with sub-sections are often seen in blogs, search result pages, pages that has a separate table of content, etc".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern was less about the text but more about the example used. I'm thinking we can showcase something that is more realistic to patterns we see in the wild. I think a table of contents of some kind would be more identifiable to someone reading the explainer

In some web pages with sub-sections that feature unique CSS styles distinct from the rest of the page, a combination of inherited global styles and highly specific CSS is used, which applies only to those sub-sections. The regular HTML structure often forces the browser to process CSS before rendering the first visual elements. When there is a significant number of styles, it can negatively impact page performance. Due to the limitations in style sharing with Declarative Shadow DOM, web authors cannot selectively share styles between the parent document and shadow roots. Here is an example of a search result page with a sub-section:

![image](images/bingserp.png)
phumai98 marked this conversation as resolved.
Show resolved Hide resolved

### Media site control widgets
Sharing styles between the parent document and shadow root is also fairly common for media site
control widgets such as play/pause buttons, volume sliders, and progress bars, to share styles
Expand Down
File renamed without changes