Primary references
These sources support the standards and technical explanations in this guide. Color Pick recommendations and product-specific limitations are identified separately in the article.
Audit repeated color literals, near duplicates, legacy rgb and hsl syntax, hard-coded component colors, and opportunities for custom properties and modern derived relationships.
Inventory every color before replacing it. Group exact values, review near duplicates, assign semantic roles, move repeated values into custom properties, and preserve a compatibility bridge. Introduce color-mix() or relative colors only where a dynamic relationship is clearer than a static token. Review every generated replacement before merging it into production.
Understand the current system before changing values.
Paste or upload the stylesheet locally.
Review color occurrences, selectors, and properties.
Separate custom-property definitions from hard-coded component values.
Identify repeated values and near duplicates.
Export the audit report before editing production code.
A variable should explain intent rather than merely repeat a hue name.
| Literal usage | Weak name | Stronger role |
|---|---|---|
| Primary button background | --blue-600 | --color-action-primary |
| Page background | --gray-50 | --color-surface-canvas |
| Error text | --red-700 | --color-text-danger |
| Focus outline | --purple | --color-focus-ring |
Near duplicates may be accidental or intentional.
Dynamic CSS is most useful when the relationship should remain tied to a source.
Consumers should not break when names change.
:root {
--old-primary: var(--color-action-primary);
--old-primary-hover: var(--color-action-primary-hover);
}A text refactor cannot prove the complete UI.
Run the build and lint suite.
Search for unresolved old variables.
Test light, dark, forced-colors, hover, active, focus, disabled, and error states.
Review contrast and visual regression.
Remove the compatibility bridge only after every consumer has migrated.
Find repeated values, hard-coded colors, and modernization opportunities locally.
No. Promote values that carry shared meaning or need coordinated change. One-off decorative colors may remain local when that improves clarity.
No. A small difference can represent a tested state or surface hierarchy. Review context before consolidating.
No. The Lab uses a conservative heuristic parser. Treat generated replacements as a reviewable proposal, especially for Sass functions, custom syntax, and complex build pipelines.
These sources support the standards and technical explanations in this guide. Color Pick recommendations and product-specific limitations are identified separately in the article.