Skip to content

UnoCSS in dev keeps the boot gate and hides the first paint #725

Backlog

Description

@Espoir-Loem

Problem

nexy/vite.py:58-60 keeps the boot gate whenever uno.config.ts exists, because UnoCSS
utilities only exist as a virtual module and there is no stylesheet link to block the first
paint. The gate is <style id="nexy-boot">html{visibility:hidden}</style> with a 2500 ms
fallback timeout (nexy/vite.py:50-55). The page is therefore blank for a moment on a cold dev
load.

#715 removed the gate for projects whose CSS is a real file. UnoCSS projects are still behind it.

Change to make

Expose the generated UnoCSS as a real stylesheet link in dev, or inline its CSS in the served
document, so the gate can be removed for UnoCSS projects too. Measure when the gate is removed
before and after the change.

Out of scope

The UnoCSS production build and CSS hot reload, which already work.

Checks

An e2e test on a project with uno.config.ts finds no nexy-boot element in the served HTML and
records a first paint with content. FCP and CLS from #713 do not get worse on plain CSS projects.

Activity

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

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