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

Hot CSS replacement is broken when theme is injected in shadow roots in Safari #16909

Closed
Artur- opened this issue May 30, 2023 · 3 comments · Fixed by #16915
Closed

Hot CSS replacement is broken when theme is injected in shadow roots in Safari #16909

Artur- opened this issue May 30, 2023 · 3 comments · Fixed by #16915

Comments

@Artur-
Copy link
Member

Artur- commented May 30, 2023

Description of the bug

When you open start.vaadin.com in Safari it looks like
image

When you do touch styles.css in the themes folder, you get
image

It seems like most of the adopted stylesheets for shadow roots go missing, e.g. the shadow root of <view-item> has 9 adopted style sheets before the update and only 1 afterwards. Lumo utility classes are no longer available inside the shadow root, which changes font sizes and a lot of other things.

Expected behavior

It stays the same

Minimal reproducible example

See the Start project

Versions

  • Vaadin / Flow version: 24.1.beta2
@Artur-
Copy link
Member Author

Artur- commented May 30, 2023

This seems to be a manifestation of https://bugs.webkit.org/show_bug.cgi?id=254844 as the problem is that new style sheets are never added to adoptedStyleSheets even though the array is mutated using

    target.adoptedStyleSheets = [sheet, ...target.adoptedStyleSheets];

The size of adoptedStyleSheets is 1 before the call and 1 also after it.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.1.0.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.2.0.alpha1 and is also targeting the upcoming stable 24.2.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment