fix: quote build script path & improve color token documentation#9417
fix: quote build script path & improve color token documentation#9417ragini-pandey wants to merge 12 commits intoelastic:mainfrom
Conversation
|
👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually? |
…n notices, and semantic guidance
e4db21a to
57e7db1
Compare
….com/ragini-pandey/eui into fix/docs-color-tokens-and-build-path
…docs-color-tokens-and-build-path
There was a problem hiding this comment.
Pull request overview
Fixes a tooling build failure when the repo path contains spaces and refreshes the EUI website’s color documentation to better emphasize semantic tokens, add missing token descriptions, and clarify deprecations.
Changes:
- Quote the
dtsgenerator.jspath inpackages/eui/scripts/compile-eui.jsto avoid space-in-path build failures. - Expand/clarify the website color token docs (new guidance text, deprecation callouts, improved section copy).
- Add description text across multiple color token tables and fix a token label typo (
backgroundBaseSkeletonMiddle).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/eui/scripts/compile-eui.js | Quotes the dtsgenerator.js invocation path to prevent failures in spaced directories. |
| packages/website/docs/utilities/color-palettes/index.mdx | Updates palette guidance text and adds deprecation messaging. |
| packages/website/docs/getting-started/theming/tokens/colors/index.mdx | Revises overall color-token guidance, adds deprecation callouts, and adjusts dataviz guidance text/imports. |
| packages/website/docs/patterns/severity/index.mdx | Removes a broken/unneeded import related to dataviz background colors. |
| packages/website/docs/getting-started/theming/tokens/colors/text_colors_table.tsx | Adds per-token descriptions for text tokens. |
| packages/website/docs/getting-started/theming/tokens/colors/background_colors_table.tsx | Adds per-token descriptions and fixes the skeleton middle token label. |
| packages/website/docs/getting-started/theming/tokens/colors/border_colors_table.tsx | Adds per-token descriptions for border tokens. |
| packages/website/docs/getting-started/theming/tokens/colors/data_vis_colors_table.tsx | Adds per-token descriptions for dataviz graphic + text tokens. |
| packages/website/docs/getting-started/theming/tokens/colors/shade_colors_table.tsx | Updates shade token descriptions with deprecation/migration guidance. |
| packages/website/docs/getting-started/theming/tokens/colors/special_colors_table.tsx | Updates special token descriptions with deprecation/migration guidance. |
| packages/website/docs/getting-started/theming/tokens/colors/severity_colors_table.tsx | Adds per-token descriptions for severity tokens. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…dex.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| EUI provides a set of color palette utility functions that return arrays of hexadecimal colors for use in charts and data visualizations. | ||
|
|
||
| :::tip When to use palettes vs. color tokens | ||
| **Color tokens** (`euiTheme.colors.vis.*`) should be your first choice for data visualizations — they are semantic, theme-aware, and automatically adapt to color modes. | ||
|
|
||
| **Color palette functions** are useful when you need a dynamic number of colors (e.g. generating a gradient with N steps), or when working with charting libraries that require arrays of colors. For categorical data with up to 10 series, prefer using the `euiColorVis0`–`euiColorVis9` tokens directly. |
There was a problem hiding this comment.
PR title/description mention a build-script fix in packages/eui/scripts/compile-eui.js (quoting the dtsgenerator.js path), but this pull request only changes website docs files. Either include the build script fix in this PR, or update the PR title/description to reflect the actual scope so reviewers/users aren’t expecting a build tooling change.
| Data visualization colors and severity colors prioritize visual clarity and data differentiation over strict contrast compliance in standard light mode. **This means some colors may not meet WCAG 3:1 contrast requirements against light backgrounds.** | ||
|
|
||
| However, in dark mode, all colors meet the minimum 3:1 contrast ratio, ensuring accessibility compliance. | ||
| For accessible use cases, enable **high contrast mode** which ensures all colors meet minimum contrast ratios. In dark mode, all colors meet the minimum 3:1 contrast ratio by default. | ||
|
|
There was a problem hiding this comment.
The text claims that enabling high contrast mode “ensures all colors meet minimum contrast ratios”, but EUI’s high contrast mode primarily enforces border/shadow adjustments (see packages/website/docs/getting-started/theming/high-contrast-mode.mdx). Please soften or scope this statement (e.g., describe it as improving contrast for specific tokens/modes rather than guaranteeing contrast for all colors), and consider aligning the table wording with the actual guarantees.
tkajtoch
left a comment
There was a problem hiding this comment.
This PR doesn't seem to contain the quote changes you mention in the title and description. I'm also not certain if the added token descriptions bring enough value right now. Our general goals are to make the documentation less verbose and agent-friendly, and I'm worried that some of the strings added here might be misleading or not precise enough.
Let me think about these changes more, and in the meantime, make sure the PRs are scoped to a single group of changes - there should never be script changes bundled with documentation changes unless they're explicitly related and create an atomic change
Summary
This PR fixes a build script path quoting issue and improves the color token documentation across the EUI website.
Build fix: The
execSynccall incompile-eui.jsthat invokesdtsgenerator.jsdid not quote the resolved path, causing the build to fail when the workspace directory contains spaces. The fix wraps the path in quotes.Documentation improvements: Added descriptions to all color token tables (text, background, border, shade, special, data vis, severity), improved introductory copy with clearer semantic token guidance, added deprecation notices for shade/special tokens and legacy palette functions, fixed a typo in
backgroundBaseSkeletonMiddle, fixed a brokenDataVisBackgroundColorimport in the severity patterns page, and improved color palette utilities documentation.Why are we making this change?
Closes #8540
compile-eui.jsis a latent bug that surfaces whenever a developer clones the repo into a directory whose path contains spaces.Screenshots #
http://localhost:3000/docs/getting-started/theming/tokens/colors/
http://localhost:3000/docs/utilities/color-palettes/
N/A — Documentation text changes only; no visual/UI component changes.
Impact to users
No breaking changes. The build script fix is internal tooling. The documentation improvements provide better guidance for EUI consumers using color tokens, especially around deprecated shade/special tokens and their semantic replacements.
QA
General checklist
Checked in both light and dark modes(no UI changes)Checked in both MacOS and Windows high contrast modes(no UI changes)Checked in mobile(no UI changes)Checked in Chrome, Safari, Edge, and Firefox(no UI changes)Checked for accessibility including keyboard-only and screenreader modes(no UI changes)Props have proper autodocs(no prop changes)Checked Code Sandbox works for any docs examples(no interactive examples added)Added or updated jest and cypress tests(documentation-only changes)Updated visual regression tests(no visual changes)If applicable, added the breaking change issue label(no breaking changes)If the changes unblock an issue in a different repo, smoke tested carefully(N/A)If applicable, file an issue to update EUI's Figma library(no UI changes)