Admin Portal v2 theme tokens, plus two fixes to existing portal docs - #344
Admin Portal v2 theme tokens, plus two fixes to existing portal docs#344Wictorgirardi wants to merge 2 commits into
Conversation
Deploying phasetwo-docs with
|
| Latest commit: |
c709765
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d33ee7c2.phasetwo-docs.pages.dev |
| Branch Preview URL: | https://feature-update-tokens-docs.phasetwo-docs.pages.dev |
|
Marking as draft — the theme-token contract is still being finalized (shared |
The token docs described the portal-private assets.portal.v2.* namespace with a cta token. The shipped contract is the shared assets.theme.v2.*, consumed by the login theme, the Admin Portal and the email templates alike, with cta folded into primary. Documents the token list once rather than twice. Both pages previously carried their own copy of the table, which is how the two had already drifted; the canonical list now lives in customizing-ui.md as the realm-attribute reference, and the Admin Portal page keeps the portal-specific parts -- runtime injection, the sidebar derivation, the legacy portal keys -- and links to it. Content corrections beyond the rename: - secondary/secondaryForeground, mutedForeground, and the derived card, cardForeground, accent, accentForeground, input and ring tokens were missing entirely. Derived tokens follow a base token until set, which is what makes a lone custom primary also move the focus ring. - Every colour token now takes a dark<Token> override. The docs described only four dark attributes. - Dropped "no effect in dark mode" from muted and border, and "the other dark surfaces are mixed from it" from darkBackground. Both were true of the colour-mix implementation that per-mode tokens replaced. - secondaryColor900 no longer affects rendering: it fed cta. Called out explicitly, since a realm that only ever customised it needs to move. - login.primaryForegroundColor was listed as a working attribute with a default. The legacy stylesheet never emitted a variable for it; it only takes effect through the token path, as the fallback for theme.v2.primaryForeground. - "If omitted, the light-mode values are used as fallbacks" was only true of the brand colours. backgroundColor falls back to the dark default instead, or dark mode would stop being dark. - The admin UI does now expose these fields, under Styles > Login rather than Styles > Portal, because the tokens are shared rather than portal-specific. Notes the per-surface default divergence (portal primary #1570c2 and radius 0.5rem against the login palette) rather than implying one set of defaults, and that email alone does not fall back to resolved defaults. Wictor's two fixes from the original commit are unchanged: the missing Color infix in the nine portal colour keys, and the visibility table's absent header.
|
Pushed Why it changedThis PR documented Documented once instead of twiceBoth pages carried their own copy of the token table — which is exactly how the two had already drifted. The canonical list now lives in Corrections beyond the rename
Also notes the per-surface default divergence (portal Your two fixes from ChecksBoth cross-page anchors verified to resolve, and all tables verified column-consistent.
|
5c8432e to
c709765
Compare
Summary
Companion to p2-inc/phasetwo-admin-portal#199, which replaces the portal's runtime CSS-class rewriting with a pared-down set of 13 CSS-variable theme tokens stored as
_providerConfig.assets.portal.v2.<token>realm attributes. This documents the new tokens and, along the way, fixes two defects in the existing portal docs.Fixes to existing docs
1. Published attribute keys that do not work.
getting-started/customizing-ui.mdlisted the portal colors as_providerConfig.assets.portal.primary100,…primary200, and so on. The server readsprimaryColor100,primaryColor200, … — theColorinfix was missing from all nine keys, so every one of them was dead. Anyone who followed that table got no styling at all. Corrected againstPortalResourceProvider.java.2. A table that never rendered. The visibility-flag table in
admin-portal/access-control.mdhad data rows but no header or delimiter row, so GFM rendered it as literal pipe-separated text rather than a table. Given a proper header.New content
admin-portal/configuration.mdmutedandbordertokens have no effect in dark mode (those surfaces are mixed fromdarkBackground), and the foreground tokens fall back in two different ways —primaryForeground/ctaForeground/darkCtaForegroundalways auto-contrast, whileforeground/darkForegroundkeep their defaults unless you set their background explicitly.primaryColor700(fallback forprimary) andsecondaryColor900(fallback forcta) still affect rendering.:::cautionbreaking-change callout: CSS targeting the old generated utility classes (.bg-primary-700,.bg-primary-gradient, …) no longer applies, and realms that customizedprimaryColor100/primaryColor900will see neutral surfaces until they set the matchingv2tokens.admin-portal/access-control.mdorg.attributes.enabledflag (new in add logos #199) and theprofile.passwordless.enabledflag, which the server has always honored but was never documented anywhere.view-organizationto view,manage-organizationto edit.trueenables a section;TRUE,1andyesdisable it ("true".equals(v)).getting-started/customizing-ui.md