Skip to content

fix: Keep values of var() apart, and support env() - #933

Merged
shuding merged 1 commit into
mainfrom
shu/var-token-boundaries
Oct 16, 2026
Merged

shuding merged 1 commit into
mainfrom
shu/var-token-boundaries

Conversation

@shuding

@shuding shuding commented Oct 16, 2026

Copy link
Copy Markdown
Member

Two fixes for values that pages ship, found rendering paco.me with the playground's screenshot page (#932).

  • Values of var() stay apart from what's next to them. Minifiers leave out spaces after functions, e.g. grid-template-columns: 192px var(--content-width)192px or font: 500 var(--text-xs)/var(--leading-s)var(--font-display). Browsers substitute tokens, so the result is still two values, but Satori substituted text, which made 640px192px. On paco.me, every font declaration, the main padding and the grid columns were invalid.
  • env() is supported, like on desktops: the safe area and keyboard insets are 0px, and other variables, e.g. the title bar areas of installed apps, use their fallbacks, or make the declaration invalid without one. Declarations with it are valid until they're computed, like the ones with var(). On paco.me, the page margins use max(24px, env(safe-area-inset-left)).

Both new tests fail without the fix.

Minifiers leave out spaces after functions, e.g. in
`var(--width)192px` or `var(--leading)var(--family)`. Like in browsers,
which substitute tokens, the values of variables now stay apart from
what's next to them, instead of becoming `640px192px`, which made the
`font`, `padding` and `grid-template-columns` of pages invalid.

`env()` is resolved like on desktops: the safe area and keyboard insets
are 0px, and other variables use their fallbacks. Declarations with it
are valid until they're computed, like the ones with `var()`.
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
satori-playground Ready Ready Preview, v0 Oct 16, 2026 4:35am UTC

@shuding
shuding merged commit a79edfe into main Oct 16, 2026
10 checks passed
@shuding
shuding deleted the shu/var-token-boundaries branch October 16, 2026 06:05
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.60.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

This branch was successfully deployed

1 active deployment
Preview — 73ed7c5b Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant