Repository navigation
Conversation
A workspace can write its own CSS over the design in Sections, styling the portal's parts by name. It renders in the tenant layer, the preview shows it, and review counts it in lines. The check on save refuses @import, url() anywhere but the workspace's own storage, expression(), behavior and <, as a refusal with the line. It warns on internal class names, offering the part to use, which Fix it for me swaps in, and on !important, tokens no part reads, unknown or renamed parts, and text and background colours on a part below 4.5:1. Old part names are rewritten as the design is read. It parses with css-tree's self-contained build, pure JavaScript with its data inlined, so the server bundle needs neither a native module nor data files beside it. Custom CSS stays a plan feature: new or changed CSS asks the plan, while CSS already published stays and removing it is always allowed.
mortondev
force-pushed
the
feat/portal-design-v2-phase5-css
branch
from
October 31, 2026 06:53
41b60e4 to
540a4d1
Compare
Member
Author
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.
The twenty-first of the stack that builds a new design engine for the portal, and the second of phase 5. A workspace can write its own CSS over the design, styling the portal's parts by name, and the CSS is checked as it is saved. Behind the
portalDesignV2flag.Custom CSS in Sections
A closed "Custom CSS" disclosure at the end of Sections, with the same editor the legacy theme's Advanced CSS uses (its lazy chunk is shared). A line names the parts to style. The CSS goes into the design's
cssfield and renders in the tenant layer, so it wins over the design without!important. The preview shows it before publishing, and Review and publish counts it in lines rather than showing it.The check on save
lib/server/domains/design/css-lint.ts:@import;url()anywhere but the workspace's own storage (/api/storage/…, sodata:and other hosts too);expression();behavior; and<..portal-nav__itemleaves.portal-nav__item--active, and longest first;!important;--qb-token no part reads;rewritePartAliases()runs when the design is read, so CSS naming a renamed part keeps working; it is idempotent.It parses with css-tree, pure JavaScript, rather than lightningcss, so the server bundle carries no native module. It imports css-tree's self-contained build (
css-tree/dist/csstree.esm): the module entry reads data files at runtime, which the server bundle does not carry, and every request then failed as the design service loaded. A test pins the import.Plan
Custom CSS stays a plan feature (
customCss), as it is for the legacy theme. Saving new or changed CSS asks the plan; CSS the published design already has stays, and removing it is always allowed, so a workspace whose plan dropped the feature can still save everything else. The REST API answers 400 for refused CSS and 403 for the plan.Verification
@importwas refused with its message; CSS styling a part with an internal class was saved with a warning, and "Fix it for me" swapped in[data-qb-part="nav-item"]; the preview applied the CSS (3px card borders); review counted it; after publishing, the live portal had 3px card borders and bold menu items. No page errors.