Repository navigation
Conversation
The property-name gate rejected any custom property containing `_` or starting with `--_`, so the importer and the publisher dropped them and every var() on them resolved to nothing. Custom properties are now checked against the spec's identifier rule; standard property names keep the stricter pattern and the denylist still applies. Custom property names also pass through toKebab unchanged, so `--brandColor` is no longer emitted as `--brand-color`. Fixes CoreBunch#616
ehnruiz
marked this pull request as ready for review
October 11, 2026 00:23
Author
|
@DavidBabinec, three small Site Import fixes found on a real Webflow import: #617 (custom properties with |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #615. The property-name gate (
isEmittablePropertyinsrc/core/publisher/classCss.ts) used one pattern for every name,/^-{0,2}[a-zA-Z][a-zA-Z0-9-]*$/. That pattern rejects any custom property containing_or starting with--_, so the stylesheet importer and the publisher both dropped them, and everyvar()on them resolved to nothing. Webflow exports generate both forms throughout (--brand---ds_mapped---background--page,--_mapped---button--fill).--…) are now checked against/^--[a-zA-Z0-9_-]+$/. Standard property names keep the stricter pattern, and thebehavior/-moz-bindingdenylist still applies to both.toKebabnow passes custom property names through unchanged. Custom properties are case-sensitive, and--brandColorwas emitted as--brand-color, which brokevar(--brandColor). I found this while reproducing Publisher drops CSS custom properties with an underscore or a leading --_ (classCss VALID_PROPERTY_RE) #615. It is the same problem (custom property names not emitted as authored), so it is in this PR. Happy to split it out if you prefer.Impact: an imported site keeps all of its custom properties. In the real 7-page Webflow site behind #615, that is the 186 of 322 design-system variables that were being dropped.
Verification
bun run build(exit 0)bun teston this commit (08041d3): 7040 pass, 0 fail (exit 0) on a quiet machine. An earlier run on a loaded machine had 15 timeouts in MCP, auth, sanitize and language-service tests; those files also passed on their own.bun run lint(exit 0)New tests fail on
mainand pass here:bagToCSSemits--card_bg,--_accentand a Webflow-style name as authored, and keeps--brandColorintact.cssToStyleRuleskeeps the Publisher drops CSS custom properties with an underscore or a leading --_ (classCss VALID_PROPERTY_RE) #615 repro's custom properties, with no warnings.--,--has space,--x;y,--a:b,font_sizeand-_xare still dropped.Checklist
docs/features/html-import.mddescribes the gate by name, not by pattern.