diff --git a/.changeset/explicit-type-roles.md b/.changeset/explicit-type-roles.md new file mode 100644 index 000000000..d25e12b4e --- /dev/null +++ b/.changeset/explicit-type-roles.md @@ -0,0 +1,6 @@ +--- +'@workflowbuilder/sdk': major +'@workflowbuilder/ui': minor +--- + +SDK text now binds explicit type roles, while deprecated UI typography classes carry their bundled Poppins family, allowing the document-wide font reset to be removed without mixed editor typography. `--wb-font-family` no longer rethemes built-in editor text; apply it explicitly to consumer-owned surfaces that need it. diff --git a/apps/docs/src/content/docs/get-started/theming.md b/apps/docs/src/content/docs/get-started/theming.md index 04bec143c..7e38646ce 100644 --- a/apps/docs/src/content/docs/get-started/theming.md +++ b/apps/docs/src/content/docs/get-started/theming.md @@ -1,6 +1,6 @@ --- title: Theming -description: Customise the editor's visual style — fonts, background, tokens — via CSS variables on :root. +description: Customise the editor's visual style — background, tokens, and consumer-owned typography — via CSS variables. sidebar: order: 5 --- @@ -9,19 +9,23 @@ The aggregated `style.css` ships with the SDK's default visual layer. Override C ## Typography -`style.css` inlines Poppins latin 400 and 600 and references the remaining Poppins and Inter faces in the adjacent `assets` directory. Preserve that `dist` layout when copying the stylesheet. A Content Security Policy (CSP) that defines `font-src` must allow both `data:` and `'self'` or the origin serving those assets. No external font CDN is contacted at runtime, so the SDK still works behind consent controls and in air-gapped deployments. +Built-in text uses bundled type styles: semantic `wb-text-*` roles on migrated surfaces and Poppins-backed deprecated classes on remaining UI primitives. `wb-text-code` uses Inter for token names and IDs; fixed-width editors retain a monospace family. `style.css` inlines the used Poppins faces and references the remaining Poppins and Inter faces in the adjacent `assets` directory. Preserve that `dist` layout when copying the stylesheet. A Content Security Policy (CSP) that defines `font-src` must allow both `data:` and `'self'` or the origin serving those assets. No external font CDN is contacted at runtime, so the SDK still works behind consent controls and in air-gapped deployments. Other weights, Inter, and non-ASCII glyphs use `font-display: swap` assets. They can briefly appear in the fallback font while the matching file loads; preload the relevant `.woff2` files when that flash of unstyled text (FOUT) is unacceptable. -Override `--wb-font-family` to use a different face: +`--wb-font-family` remains available for consumer-owned surfaces that opt into it; built-in roles do not read this variable: ```css :root { --wb-font-family: 'Inter', system-ui, -apple-system, sans-serif; } + +.my-workflow-surface { + font-family: var(--wb-font-family); +} ``` -Provide the font yourself (via `@font-face`, `@fontsource/`, etc.) — the SDK only consumes the variable. +Provide any replacement font yourself via `@font-face`, `@fontsource/`, or an equivalent local source. ## Other tokens diff --git a/apps/docs/src/content/docs/ui-library/typography.mdx b/apps/docs/src/content/docs/ui-library/typography.mdx index 418e4ed3d..b13e8d23a 100644 --- a/apps/docs/src/content/docs/ui-library/typography.mdx +++ b/apps/docs/src/content/docs/ui-library/typography.mdx @@ -33,6 +33,8 @@ Regular to 400. Every family except UI/Code doubles with an `-emphasized` variant (`wb-text-title-m-emphasized`), for 39 styles total. +`wb-text-code` is proportional Inter. Editors whose cursor model requires fixed-width glyphs, such as Ace, keep a monospace family while using the role's size, weight, and line-height. + Which role to reach for: | Context | Recommended role | @@ -55,6 +57,6 @@ rem). Until the token export ships them through `@workflowbuilder/ui/tokens.css`, the classes define these primitives themselves — the migration swaps the source without touching consumers. -The pre-2.0 `ax-public-*` typography classes are deprecated: components move -to `wb-text-*` as they are redesigned, and the old classes are removed in -3.0.0. Do not adopt them in new code. +The pre-2.0 `ax-public-*` typography classes are deprecated and retained only +for compatibility while components move to `wb-text-*`. Do not adopt them in +new code; their removal will be announced with a future major release. diff --git a/packages/sdk/README.md b/packages/sdk/README.md index 94ae6097f..578c28b99 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -205,12 +205,11 @@ The editor exposes a small set of CSS custom properties for top-level styling. O ```css :root { --wb-background-color: #fafafa; - --wb-font-family: 'Inter', system-ui, sans-serif; --wb-transition: 0.15s ease-in; } ``` -Available `--wb-*` tokens: `--wb-background-color`, `--wb-font-family`, `--wb-transition`, plus scrollbar styling (`--wb-scroll-width`, `--wb-scroll-radius`, `--wb-scroll-thumb-color`, `--wb-scroll-track-color`). +Available `--wb-*` tokens: `--wb-background-color`, `--wb-transition`, plus scrollbar styling (`--wb-scroll-width`, `--wb-scroll-radius`, `--wb-scroll-thumb-color`, `--wb-scroll-track-color`). Built-in editor text uses bundled type styles: semantic `wb-text-*` roles on migrated surfaces and Poppins-backed deprecated classes on remaining UI primitives. `--wb-font-family` remains available for consumer-owned surfaces that opt into `font-family: var(--wb-font-family)`; overriding it no longer rethemes built-in text. Deeper color and spacing customization goes through the generated `--wb-*` design-token layer from `@workflowbuilder/ui`. Hand-authored overrides use `--wb-public-*`. The UI Library's component pages include generated CSS-variable tables for component-local UI overrides. Full guide: [Design system and customization](https://www.workflowbuilder.io/docs/overview/features/design-system-and-customization/). diff --git a/packages/sdk/src/components/form/label/label.module.css b/packages/sdk/src/components/form/label/label.module.css index b5dd89339..c7e64ab13 100644 --- a/packages/sdk/src/components/form/label/label.module.css +++ b/packages/sdk/src/components/form/label/label.module.css @@ -31,12 +31,12 @@ } .large { - composes: ax-public-p10 from global; + composes: wb-text-body-s from global; } .medium, .small { - composes: ax-public-p11 from global; + composes: wb-text-label-s from global; } .title { font-weight: 600; diff --git a/packages/sdk/src/components/form/message/message.module.css b/packages/sdk/src/components/form/message/message.module.css index b7766af6a..aedf7bfe4 100644 --- a/packages/sdk/src/components/form/message/message.module.css +++ b/packages/sdk/src/components/form/message/message.module.css @@ -39,7 +39,7 @@ html[data-theme='dark'] .container--warning { } .content { - composes: ax-public-p11 from global; + composes: wb-text-body-s from global; padding-top: 1px; } diff --git a/packages/sdk/src/components/loader/loader.module.css b/packages/sdk/src/components/loader/loader.module.css index 641d60bc2..0cf067861 100644 --- a/packages/sdk/src/components/loader/loader.module.css +++ b/packages/sdk/src/components/loader/loader.module.css @@ -22,7 +22,6 @@ align-items: center; width: 100%; height: 100%; - font-size: 1.25rem; } } diff --git a/packages/sdk/src/components/loader/loader.tsx b/packages/sdk/src/components/loader/loader.tsx index 2ef87aebc..24bb91d56 100644 --- a/packages/sdk/src/components/loader/loader.tsx +++ b/packages/sdk/src/components/loader/loader.tsx @@ -29,7 +29,7 @@ export const Loader = memo(({ isLoading, isSemiTransparent }: LoaderType) => { return (
-
{t('loader.text')}
+
{t('loader.text')}
); }); diff --git a/packages/sdk/src/features/app-bar/app-bar.module.css b/packages/sdk/src/features/app-bar/app-bar.module.css index bff34f802..18e8772fe 100644 --- a/packages/sdk/src/features/app-bar/app-bar.module.css +++ b/packages/sdk/src/features/app-bar/app-bar.module.css @@ -60,12 +60,12 @@ .folder-name { color: var(--wb-app-bar-folder-name-color); - composes: ax-public-p9 from global; + composes: wb-text-body-m from global; } .title { color: var(--wb-app-bar-diagram-title-color); - composes: ax-public-p9 from global; + composes: wb-text-body-m from global; min-height: 1em; min-width: 1em; cursor: pointer; diff --git a/packages/sdk/src/features/diagram/edges/edge-label-renderer/edge-label-renderer.tsx b/packages/sdk/src/features/diagram/edges/edge-label-renderer/edge-label-renderer.tsx index 525a093a4..9830a912e 100644 --- a/packages/sdk/src/features/diagram/edges/edge-label-renderer/edge-label-renderer.tsx +++ b/packages/sdk/src/features/diagram/edges/edge-label-renderer/edge-label-renderer.tsx @@ -58,6 +58,7 @@ export function EdgeLabel({ return (