Skip to content
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

feat: Expose xmodule xblocks Sass variables as vanilla CSS variables #35233

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cms/static/sass/studio-main-v1.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

// +Libs and Resets - *do not edit*
// ====================

@import '_builtin-block-variables';
@import 'bourbon/bourbon'; // lib - bourbon
@import 'vendor/bi-app/bi-app-ltr'; // set the layout for left to right languages
@import 'build-v1'; // shared app style assets/rendering
46 changes: 46 additions & 0 deletions common/static/sass/_builtin-block-variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* In pursuit of decoupling the built-in XBlocks from edx-platform's Sass build
* and ensuring comprehensive theming support in the extracted XBlocks,
* we need to expose Sass variables as CSS variables.
*
* Ticket/Issue: https://github.com/openedx/edx-platform/issues/35173
*/
@import 'bourbon/bourbon';
@import 'lms/theme/variables';
@import 'lms/theme/variables-v1';
@import 'cms/static/sass/partials/cms/theme/_variables';
@import 'cms/static/sass/partials/cms/theme/_variables-v1';
@import 'bootstrap/scss/variables';
@import 'vendor/bi-app/bi-app-ltr';

:root {
--primary: $primary;
--transparent: $transparent;
--white: $white;
--black: $black;
--gray: $gray;
--lightGrey: $lightGrey;
--darkGrey: $darkGrey;
--gray-l2: $gray-l2;
--gray-l3: $gray-l3;
--gray-l4: $gray-l4;
--gray-l6: $gray-l6;
--blue: $blue;
--blue-d1: $blue-d1;
--blue-d2: $blue-d2;
--blue-d4: $blue-d4;
--shadow: $shadow;
--shadow-l1: $shadow-l1;
--link-color: $link-color;
--sidebar-color: $sidebar-color;
--body-color: $body-color;
--border-color: $border-color;
--error-color: $error-color;
--very-light-text: $very-light-text;
--lighter-base-font-color: $lighter-base-font-color;
--action-primary-active-bg: $action-primary-active-bg;
--baseline: $baseline;
--font-family-sans-serif: $font-family-sans-serif;
--static-path: $static-path;
--tmg-f2: $tmg-f2;
}
2 changes: 2 additions & 0 deletions lms/static/sass/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// LMS-specific variables

@import '_builtin-block-variables';

$text-width-readability-max: 1080px;

// LMS-only colors
Expand Down
Loading