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

feat: adapt global styles in WCs SSR #502

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Conversation

aralroca
Copy link
Collaborator

Related #156

The imported CSS files were correctly adapted in the Web Components, but the SSR part was missing, which this application also does unless you disable the adaptation of global styles inside the WCs. Now it works, without any FOUC anymore.

Before this PR, it was already working for the inline style, and with this change it is still working. It is only adapted to work with CSS files as well.

So adding this to the layout:

Screenshot 2024-09-30 at 16 34 54

Then the DSD of the Web Components:

<my-element>
  <template shadowroot="open">
    <!-- ... -->
      <style>@import '/style-1234.css';@import '/nav-1234.css';@import '/footer-1234.css'</style>
  </template>
</my-element>

*1234 is an example of hash.

This is the current way to do it with DSD. In the future when they accept this proposal, it will be different and we will adapt.

@aralroca aralroca merged commit f5853b9 into main Sep 30, 2024
0 of 4 checks passed
@aralroca aralroca deleted the aralroca/fix-ssr-styles-in-wcs branch September 30, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant