[Draft] Introducing more granular CSS design tokens for UI.#19953
Draft
pszczesniak wants to merge 35 commits intomasterfrom
Draft
[Draft] Introducing more granular CSS design tokens for UI.#19953pszczesniak wants to merge 35 commits intomasterfrom
pszczesniak wants to merge 35 commits intomasterfrom
Conversation
…ck-border-radius.
pszczesniak
commented
Mar 12, 2026
pszczesniak
commented
Mar 12, 2026
pszczesniak
commented
Mar 12, 2026
packages/ckeditor5-ui/theme/components/dropdown/listdropdown.css
Outdated
Show resolved
Hide resolved
pszczesniak
commented
Mar 12, 2026
…nd colorselector radius to semantic tokens, and clarifying surface/spacing/layout docs.
…semantic color files.
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
A brief summary of what this PR changes.
📌 Related issues
💡 Additional information
Problem
CKEditor 5 exposes foundation CSS variables (
--ck-border-radius,--ck-spacing-unit, etc.) that are too coarse-grained for fine-tuned customization. Changing one variable affectsall UI elements simultaneously, preventing selective customization of individual components.
Solution
A three-tier token hierarchy where each layer references the one above it:
theme/globals/_*.css,theme/globals/colors/_foundation.css--ck-spacing-sm,--ck-color-base-active,--ck-radius-basetheme/globals/_semantic-*.css,theme/globals/colors/_semantic-*.css--ck-color-interactive-hover-surface,--ck-border-radius-controltheme/components/**/*.css--ck-button-border-radius,--ck-toolbar-background-colorNaming convention
--ck-{domain}-{scale}— e.g.,--ck-spacing-sm,--ck-duration-fast,--ck-radius-base--ck-{domain}-{role}-{property}— e.g.,--ck-color-surface-container,--ck-spacing-control-padding-inline--ck-{component}-{part?}-{state?}-{property}— e.g.,--ck-button-default-hover-background-color,--ck-dialog-border-radiusA full naming guide is in
packages/ckeditor5-ui/docs/framework/theme-token-naming.md.Key changes
xs–xl), font sizes (xs–xl), shadows (shadow-md/lg), z-index (z-base/overlay/modal), focus, motion tokens renamed to match moderndesign system conventions (Tailwind, Spectrum, Atlassian)
hsl()values from semantic files moved tocolors/_foundation.css, preparing for a future color palette system--ck-color-button-*) migrated to component-first naming (--ck-button-*-color) in their respective component filesborder-color(not the fullbordershorthand), so customizing--ck-button-border-widthno longer causes a visual jump onfocus
--ck-*-bordertokens_legacy-foundation-aliases.css,_legacy-component-aliases.css)tests/manual/ui-customization/with live editing, per-token reset, reference labels, and cascading value updatesBackward compatibility
All existing CSS custom property names continue to work. Legacy alias files map old names → new names:
🧾 Checklists
Use the following checklists to ensure important areas were not overlooked.
This does not apply to feature-branch merges.
If an item is not relevant to this type of change, simply leave it unchecked.
Author checklist
Reviewer checklist
t()(if any).