Skip to content

Comments

Add color tokens and hardcoded colors audit documentation#602

Open
sthirumal wants to merge 3 commits intomainfrom
580-tokcolor
Open

Add color tokens and hardcoded colors audit documentation#602
sthirumal wants to merge 3 commits intomainfrom
580-tokcolor

Conversation

@sthirumal
Copy link
Contributor

css token and css color value of style.css and /blocks css and the css token suggestion.

Fix #580

Test URLs:

Please refer to COLOR_TOKENS_HARDCODED_AUDIT.md file

@aem-code-sync
Copy link

aem-code-sync bot commented Feb 11, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@aem-code-sync
Copy link

aem-code-sync bot commented Feb 11, 2026

Page Scores Audits Google
📱 / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@sthirumal
Copy link
Contributor Author

Please refer to COLOR_TOKENS_HARDCODED_AUDIT.md

Summary of this file

  • Part 1: All color-related tokens are defined in styles/styles.css in :root: 21 single-value color tokens, 7 semantic aliases, and 16 gradient tokens (including --modal-backdrop-gradient). The tables above list each token and the hex/rgb values they use.
  • Part 2: Every line listed above uses at least one hex or rgb color that is not coming from a token defined in styles/styles.css. Replacing these with new or existing tokens in styles.css would centralize colors and make them easier to change.
  • Part 3: Suggested new --color-* and --gradient-* tokens derived from Part 2. Add the ones you need to styles.css and replace hardcoded values in the listed locations.

…a new script to group CSS color values by perceptual similarity.
@sthirumal
Copy link
Contributor Author

@helms-charity Added part 4

Part 4: Part 3 colors are grouped by perceptual similarity (Delta E ≤ 1). Within each group, one canonical value and one token can replace all listed values and locations without visible change. Use the summary table to pick one token per group and reduce token count while keeping appearance consistent.

Please review it.

Let me know if you would like me to increase deltaE value more than 1.

…and line numbers for suggested tokens, enhancing usability for find-and-replace operations.
@sthirumal
Copy link
Contributor Author

Part 5: Same Part 4 groups with an additional Locations (file: line) column listing the exact file path and line numbers where each suggested token (or the color it replaces) is used. Use Part 5 for find-and-replace when applying tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add all colors to tokens

1 participant