Skip to content

refactor(planet): migrate planetThemes.css hardcoded colours to CSS tokens#7430

Open
adarsh-yadav1 wants to merge 1 commit into
sugarlabs:masterfrom
adarsh-yadav1:refactor/planet-css-tokens
Open

refactor(planet): migrate planetThemes.css hardcoded colours to CSS tokens#7430
adarsh-yadav1 wants to merge 1 commit into
sugarlabs:masterfrom
adarsh-yadav1:refactor/planet-css-tokens

Conversation

@adarsh-yadav1
Copy link
Copy Markdown

PR Category

  • Bug Fix
  • Feature
  • Performance
  • Tests
  • Documentation

Summary

Replaces all hardcoded hex colour values in planet/css/planetThemes.css
with CSS custom property tokens from css/tokens.css, and wires
css/tokens.css into planet/index.html.

What Changed

  • planet/css/planetThemes.css — 163 hardcoded hex values replaced
    with token references across dark and high-contrast themes
  • planet/index.html — added import of ../css/tokens.css

Before vs After

Element Before After
Dark background #303030 var(--color-background)
Dark text #e0e0e0 var(--color-text-primary)
Dark border #444444 var(--color-border)
Dark surface #424242 var(--color-surface-raised)
HC background #000080 var(--color-background)
HC text #ffff00 var(--color-text-primary)
HC heading #ffff00 var(--color-heading)

Screenshots

Light theme

image

Dark theme

image

High contrast theme

image

Test Plan

  • Planet page renders correctly in light theme
  • Planet page renders correctly in dark theme
  • Planet page renders correctly in high-contrast theme
  • Card, modal, dropdown components verified visually in browser
  • Pre-existing aidebugger.test.js failure confirmed unrelated

Note

This PR depends on css/tokens.css being present, introduced in
PR #7366 . The import path ../css/tokens.css
is correct for the merged state.

Why

Part of #6606

Directly satisfies acceptance criterion 6 from the DMP 2026 project
ticket: "The Planet page uses the same token system as the main app."
All colour decisions in the Planet page now cascade from the same
tokens defined in css/tokens.css, enabling instant theme switching
without page reload.

@github-actions github-actions Bot added feature Adds new functionality size/L Large: 250-499 lines changed labels May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Jest Test Results

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Coverage: Statements: 48.11% | Branches: 39.52% | Functions: 52.84% | Lines: 48.52%
Master Coverage: Statements: 48.11% | Branches: 39.52% | Functions: 52.84% | Lines: 48.52%

Note: These failures may be introduced by this PR or may already exist in the master branch.
Tip: Update your branch with the latest master and rerun tests.
If the same failures are present on master, they are likely not introduced by this PR.

Failed Tests:

aidebugger.test.js

@adarsh-yadav1
Copy link
Copy Markdown
Author

@walterbender @sum2it This migrates all hardcoded colours in
planetThemes.css to CSS tokens and wires tokens.css into the planet
page. Visually verified in light, dark, and high-contrast themes.
Ready for review.

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

Labels

feature Adds new functionality size/L Large: 250-499 lines changed

Projects

Development

Successfully merging this pull request may close these issues.

1 participant