Skip to content

<style /> Node Replacement Breaks Order in Development #35

Open
@eerikson

Description

@eerikson

As I understand from this comment, <style /> nodes are stripped from the SSR version of the page and re-inserted to preserve source maps. However, the order appears to be lost during this replacement—as they are removed from DOM nonsequentially, but added again sequentially—causing a brief initial change in certain styles (especially overrides) that rely on document order.

To be clear, relying on module order as a means of writing CSS is not something I necessarily think this package should support. The problem I think is that when anybody tries to do it (a natural assumption coming from traditional CSS composition), inconsistent results are shown, often creating false positives that lead to larger problems. I'd love to see the order maintained from the server for this purpose.

As it's a server-related issue I'm not sure what a meaningful online example might look like, but I'm happy to provide any further context or information.

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