Skip to content

feat: add Open edX Dark theme#4331

Draft
ihor-romaniuk wants to merge 1 commit into
openedx:release-23.xfrom
raccoongang:romaniuk/feat/dark-theme
Draft

feat: add Open edX Dark theme#4331
ihor-romaniuk wants to merge 1 commit into
openedx:release-23.xfrom
raccoongang:romaniuk/feat/dark-theme

Conversation

@ihor-romaniuk

Copy link
Copy Markdown
Contributor

Summary

  • Add a new Open edX Dark theme — full dark token set (tokens/src/themes/dark/**) and committed generated CSS (styles/css/themes/dark/**), built via npm run build-tokens --all-themes
  • Make hardcoded component styles theme-aware so they render correctly under any theme: --pgn-color-white/-blackbg-base/headings-base; theme-driven Modal popup arrow + scroll-shadow, DataTable loading overlay, Skeleton, and ProductTour shadows
  • Lighten colored foregrounds for dark surfaces (links, outline buttons, IconButton, form validation, Breadcrumb/Stepper/Nav, SelectMenu link trigger), centralized in color.theme.default.*
  • Distinguish Alert / variant background colors on dark surfaces
  • Update doc examples that hardcoded light backgrounds (Modal/*.mdx, Menu/README.md) so popups/dialogs display correctly in dark
  • Integrate the dark theme into the docs site (www) and example app, including a theme switcher
  • lib/build-scss.js: build core + theme variants sequentially to avoid a theme-urls.json race condition

Context

Paragon themes are driven by design tokens, but only the light theme shipped — there was no usable dark theme. This PR adds one. While implementing it, many components turned out not to be theme-aware: they hardcoded white/black or pointed foreground tokens at the dark end of the color ramps, so they were invisible or low-contrast on dark surfaces. Those are fixed to consume theme tokens, with no change to the light theme (light-theme token files are separate and --pgn-color-bg-base/-headings-base resolve to the same white/black they did before). The result is a production-ready dark theme that existing consumers can opt into without affecting current light-theme behavior.

Manual Test plan

  • Run npm start from the repo root, open the theme switcher, select Open edX Dark, and confirm the docs site renders in dark
  • Spot-check key components in dark: Button (solid + outline variants), Hyperlink, Form (inputs + validation), Alert (all variants distinguishable), DataTable (incl. loading state — dark dim, not a white flash), Modal / ModalPopup (content + arrow on a dark surface), Menu / SelectMenu (link variant trigger legible), Chip, Breadcrumb, Stepper, Nav
  • Switch back to light and confirm it is unchanged (no regression)
  • Confirm npm run build-tokens and ./bin/paragon-scripts.js build-scss produce core, light, and dark and a complete theme-urls.json
  • Confirm npx jest passes (977/977)
  • Confirm the example app (example/) theme switcher toggles between light and dark

Add a new dark theme (tokens/src/themes/dark/** + generated styles/css/themes/dark/**) and the wiring to make components render correctly under it.

- Make hardcoded component styles theme-aware: white/black → bg-base/headings-base; theme-driven Modal popup arrow + scroll-shadow, DataTable loading overlay, Skeleton, and ProductTour shadows
- Lighten foreground colors for dark surfaces (links, outline buttons, IconButton, form validation, breadcrumb/stepper/nav, SelectMenu link) via centralized color.theme.default.*
- Distinguish Alert and variant background colors on dark
- Update doc examples that hardcoded light backgrounds (Modal *.mdx, Menu README) so popups/dialogs display correctly
- Integrate the dark theme into the docs site (www) and example app, including a theme switcher
- build-scss: build core + theme variants sequentially to avoid a theme-urls.json race
@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Jun 12, 2026
@netlify

netlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploy Preview for paragon-openedx-v23 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b8fc963
🔍 Latest deploy log https://app.netlify.com/projects/paragon-openedx-v23/deploys/6a2bfccb32584f0008219832
😎 Deploy Preview https://deploy-preview-4331--paragon-openedx-v23.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @ihor-romaniuk!

This repository is currently maintained by @openedx/committers-paragon.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

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

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants