Skip to content

feat: Support CSS variable overrides in LMS styles - #39469

Open
xitij2000 wants to merge 2 commits into
openedx:masterfrom
open-craft:kshitij/css-props-problem-block
Open

xitij2000 wants to merge 2 commits into
openedx:masterfrom
open-craft:kshitij/css-props-problem-block

Conversation

@xitij2000

@xitij2000 xitij2000 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds CSS custom properties for shared LMS styles, buttons, forms, headings and ProblemBlock display styles so themes can override these variables at runtime as well.

Existing SASS values are retained as fallbacks, so the UX is unchanged if no properties are set.

Supporting information

Our main aim is to support styling the problem block using CSS vars. When combined with #39191 this will allow varying the theme on a per-course basis.

Testing instructions

https://gist.github.com/xitij2000/e11b8ae623e1a9bb02ba20f61a52c040

Deadline

None

Other information

Claude was used to assist in the discovery of vars and in testing and reviewing this PR.

private-ref: https://tasks.opencraft.com/browse/BB-11428

Adds CSS custom properties for shared LMS styles, buttons, forms, headings and ProblemBlock display styles so themes can override these variables at runtime as well.

Existing SASS values are retained as fallbacks, so the UX is unchanged if no properties are set.
@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 Dec 1, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @xitij2000!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform-oncall.

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.

Details
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.

@Kelketek

Kelketek commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@xitij2000 This is working for me, but I noticed that the background color of the submit button doesn't seem to be changing even when other things are. Hovering over the button does change it, though. That one seems pretty critical since it's prominent. Other than that this is looking good to me-- all the lines swapping to variables are sensible and most of it is indeed changing as needed.

@xitij2000

Copy link
Copy Markdown
Contributor Author

@Kelketek I think this is because we're using extracted problem blocks, and these changes are to the local xblock which needs an option to set. I've updated the testing instructions in the gist.

I've also created the PR to xblocks-core for this so you can optionally install that. I've focused on getting it working with the local block for now since that's quicker to iterate and I think it'll be easy to transfer the changes over.

@Kelketek

Kelketek commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@xitij2000 Thanks-- I also saw your instructions on our internal ticket about using the internal block verses the extracted block here. I've been able to verify that this works great with the internal block, so this is 👍 from me.

👍

  • I tested this: CSS variables switch out as expected, and look just as before when not set.
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation
  • Added to the Code Drift project board (for backports)

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Dec 2, 2026

This branch has not been deployed

No deployments
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: Ready for Review

Development

Successfully merging this pull request may close these issues.

3 participants