-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose builtin block Sass variables as CSS variables #35173
Comments
kdmccormick
changed the title
Convert builtin block Sass vars into CSS vars
Convert builtin block Sass into vanilla CSS
Jul 25, 2024
kdmccormick
changed the title
Convert builtin block Sass into vanilla CSS
Convert builtin block Sass variables into CSS variables
Aug 12, 2024
@kdmccormick I have moved point 4 to this new issue, please remove it from this story |
kdmccormick
changed the title
Convert builtin block Sass variables into CSS variables
Expose builtin block Sass variables as CSS variables
Aug 13, 2024
github-project-automation
bot
moved this from 👀 In review
to ✅ Done
in Aximprovements Team
Aug 20, 2024
rediris
pushed a commit
to gymnasium/edx-platform
that referenced
this issue
Aug 27, 2024
…penedx#35233) * feat: Expose xmodule xblocks Sass variables as vanilla CSS variables * openedx#35173
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Goal
As a prerequisite to extracting the blocks into their own repo, we need to decouple the built-in XBlocks from edx-platform's Sass build. We can achieve this by exposing the blocks' Sass vars into CSS vars.
Background
Currently, the built-in XBlocks are styled by .scss (aka Sass) files in ./xmodule/assets. Each Sass file is applied to its corresponding block using the
xmodule.util.builtin_assets.add_sass_to_fragment
function (PollBlock example). These XBlock Sass files are compiled as part of ./scripts/compile_sass.sh, which is executed as part of npm run build.Each builtin block's Sass file references several Sass variables (for example,
$bg-color
). These variables can be customized by comprehensive themes. Here is an example of how tutor-indigo customizes the variables.These Sass variables need to keep working when the blocks are extracted, but we cannot actually use the Sass variables in the extracted blocks.
Approach
$bg-color
or$success
.--bg-color: $bg-color
:root { ... }
common/static/sass/_builtin-block-variables.scss
file intolms/static/base/variables.scss
andcms/static/sass/_base.scss
The text was updated successfully, but these errors were encountered: