Skip to content

FOUC while loading javascript style library that needs to be loaded before DOM loading #6227

Closed
@bhvngt

Description

@bhvngt

Describe the bug

As per this comment from @Rich-Harris, after #6174 FOUC should not be possible when we are importing global css within root layout.

I have been using a style javascript library that needs to be loaded before any DOM content gets loaded. I could see FOUC happening. This is different than the scenario where styles are imported which, as per the comment, gets imported as style tag.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-7xrgjy?file=src%2Froutes%2F%2Blayout.svelte,package.json,package-lock.json&terminal=dev

In the following reproduction one can see a flicker of FOUC TEST happening on the right hand side of the band. It's best to see the preview in a separate tab.

Logs

No response

System Info

@sveltejs/kit: 1.0.0-next.431
vite: 3.0.9

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions