Skip to content

Commit 375b9d9

Browse files
authored
feat: Expose xmodule xblocks Sass variables as vanilla CSS variables (#35233)
* feat: Expose xmodule xblocks Sass variables as vanilla CSS variables * #35173
1 parent 688242a commit 375b9d9

3 files changed

Lines changed: 77 additions & 0 deletions

File tree

cms/static/sass/studio-main-v1.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
// +Libs and Resets - *do not edit*
1717
// ====================
18+
19+
@import '_builtin-block-variables';
1820
@import 'bourbon/bourbon'; // lib - bourbon
1921
@import 'vendor/bi-app/bi-app-ltr'; // set the layout for left to right languages
2022
@import 'build-v1'; // shared app style assets/rendering
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* In pursuit of decoupling the built-in XBlocks from edx-platform's Sass build
3+
* and ensuring comprehensive theming support in the extracted XBlocks,
4+
* we need to expose Sass variables as CSS variables.
5+
*
6+
* Ticket/Issue: https://github.com/openedx/edx-platform/issues/35173
7+
*/
8+
@import 'bourbon/bourbon';
9+
@import 'lms/theme/variables';
10+
@import 'lms/theme/variables-v1';
11+
@import 'cms/static/sass/partials/cms/theme/_variables';
12+
@import 'cms/static/sass/partials/cms/theme/_variables-v1';
13+
@import 'bootstrap/scss/variables';
14+
@import 'vendor/bi-app/bi-app-ltr';
15+
@import 'edx-pattern-library-shims/base/_variables.scss';
16+
17+
:root {
18+
--action-primary-active-bg: $action-primary-active-bg;
19+
--all-text-inputs: $all-text-inputs;
20+
--base-font-size: $base-font-size;
21+
--base-line-height: $base-line-height;
22+
--baseline: $baseline;
23+
--black: $black;
24+
--black-t2: $black-t2;
25+
--blue: $blue;
26+
--blue-d1: $blue-d1;
27+
--blue-d2: $blue-d2;
28+
--blue-d4: $blue-d4;
29+
--body-color: $body-color;
30+
--border-color: $border-color;
31+
--bp-screen-lg: $bp-screen-lg;
32+
--btn-brand-focus-background: $btn-brand-focus-background;
33+
--correct: $correct;
34+
--danger: $danger;
35+
--darkGrey: $darkGrey;
36+
--error-color: $error-color;
37+
--font-bold: $font-bold;
38+
--font-family-sans-serif: $font-family-sans-serif;
39+
--general-color-accent: $general-color-accent;
40+
--gray: $gray;
41+
--gray-300: $gray-300;
42+
--gray-d1: $gray-d1;
43+
--gray-l2: $gray-l2;
44+
--gray-l3: $gray-l3;
45+
--gray-l4: $gray-l4;
46+
--gray-l6: $gray-l6;
47+
--incorrect: $incorrect;
48+
--lightGrey: $lightGrey;
49+
--lighter-base-font-color: $lighter-base-font-color;
50+
--link-color: $link-color;
51+
--medium-font-size: $medium-font-size;
52+
--partially-correct: $partially-correct;
53+
--primary: $primary;
54+
--shadow: $shadow;
55+
--shadow-l1: $shadow-l1;
56+
--sidebar-color: $sidebar-color;
57+
--small-font-size: $small-font-size;
58+
--static-path: $static-path;
59+
--submitted: $submitted;
60+
--success: $success;
61+
--tmg-f2: $tmg-f2;
62+
--tmg-s2: $tmg-s2;
63+
--transparent: $transparent;
64+
--uxpl-gray-background: $uxpl-gray-background;
65+
--uxpl-gray-base: $uxpl-gray-base;
66+
--uxpl-gray-dark: $uxpl-gray-dark;
67+
--very-light-text: $very-light-text;
68+
--warning: $warning;
69+
--warning-color: $warning-color;
70+
--warning-color-accent: $warning-color-accent;
71+
--white: $white;
72+
--yellow: $yellow;
73+
}

lms/static/sass/_variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// LMS-specific variables
22

3+
@import '_builtin-block-variables';
4+
35
$text-width-readability-max: 1080px;
46

57
// LMS-only colors

0 commit comments

Comments
 (0)