Skip to content

How does this avoid flash of unstyled content (FOUC)? #8

@matthewmueller

Description

@matthewmueller

Hey there, really interesting library. I was surprised about how little code there was!

Curious how this works:

This uses MutationObserver to monitor the DOM, and the moment a <style> tag is seen, it scopes the styles to whatever the parent element is. No flashing or popping.

Do MutationObserver observers always kick in before styling is applied? I would have expected a race between the mutation observers firing and the styles being applied, where sometimes mutation observers win, sometimes <style> wins

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions