Skip to content

Commit f9579ac

Browse files
committed
refactor: update styles to css variables
1 parent 540457f commit f9579ac

File tree

7 files changed

+37
-54
lines changed

7 files changed

+37
-54
lines changed

src/App.scss

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
// frontend-app-*/src/index.scss
2-
@import "~@edx/brand/paragon/fonts";
3-
@import "~@edx/brand/paragon/variables";
4-
@import "~@openedx/paragon/scss/core/core";
5-
@import "~@edx/brand/paragon/overrides";
2+
@use "@openedx/paragon/styles/css/core/custom-media-breakpoints" as paragonCustomMediaBreakpoints;
63

74
$fa-font-path: "~font-awesome/fonts";
85
@import "~font-awesome/scss/font-awesome";
96

10-
$input-focus-box-shadow: $input-box-shadow; // hack to get upgrade to paragon 4.0.0 to work
7+
$input-focus-box-shadow: var(--pgn-elevation-form-input-base); // hack to get upgrade to paragon 4.0.0 to work
118

129
@import "~@edx/frontend-component-footer/dist/_footer";
1310
@import "~@edx/frontend-component-header/dist/index";

src/components/FilePreview/FileCard.scss

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
@import "@openedx/paragon/scss/core/core";
2-
31
.file-card {
4-
margin: map-get($spacers, 1) 0;
2+
margin: var(--pgn-spacing-spacer-1) 0;
53

64
.file-card-title {
75
text-overflow: ellipsis;
@@ -26,8 +24,8 @@
2624
white-space: pre-wrap;
2725
}
2826

29-
@include media-breakpoint-down(sm) {
27+
@media (--pgn-size-breakpoint-max-width-sm) {
3028
.file-card-title {
31-
width: calc(map-get($container-max-widths, "sm")/2);
29+
width: calc(var(--pgn-size-container-max-width-sm)/2);
3230
}
33-
}
31+
}

src/containers/ListView/ListView.scss

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
@import "@openedx/paragon/scss/core/core";
2-
31
span.pgn__icon.breadcrumb-arrow {
42
width: 16px !important;
53
height: 16px !important;
64
};
75

86
.empty-submission {
9-
width: map-get($container-max-widths, "sm");
7+
width: var(--pgn-size-container-max-width-sm);
108
display: flex;
119
flex-direction: column;
1210
justify-content: center;
@@ -15,7 +13,7 @@ span.pgn__icon.breadcrumb-arrow {
1513
margin: auto;
1614

1715
> img {
18-
padding: map-get($spacers, 5);
16+
padding: var(--pgn-spacing-spacer-5);
1917
}
2018
}
2119

src/containers/ResponseDisplay/ResponseDisplay.scss

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
@import "@openedx/paragon/scss/core/core";
2-
31
.response-display {
4-
padding: map-get($spacers, 0);
5-
width: map-get($container-max-widths, "md");
2+
padding: var(--pgn-spacing-spacer-0);
3+
width: var(--pgn-size-container-max-width-md);
64
overflow-y: hidden;
75
height: fit-content;
86

97
.submission-files {
108
.submission-files-title {
11-
padding: map-get($spacers, 3);
9+
padding: var(--pgn-spacing-spacer-3);
1210
border-radius: calc(0.375rem - 1px);
1311
border-bottom: 1px solid transparent;
1412
transition: border-color 100ms ease 150ms;
@@ -25,13 +23,13 @@
2523
cursor: initial;
2624

2725
> h3 {
28-
color: $gray-300;
26+
color: var(--pgn-color-gray-300);
2927
}
3028
}
3129
}
3230

3331
.submission-files-body {
34-
padding: map-get($spacers, 3);
32+
padding: var(--pgn-spacing-spacer-3);
3533
padding-top: 0;
3634

3735
.submission-files-table thead {
@@ -41,7 +39,7 @@
4139
}
4240

4341
.preview-display {
44-
padding: map-get($spacers, 3) 0;
42+
padding: var(--pgn-spacing-spacer-3) 0;
4543
}
4644

4745
.response-display-text-content {
@@ -50,12 +48,12 @@
5048
}
5149
}
5250

53-
@include media-breakpoint-down(sm) {
51+
@media (--pgn-size-breakpoint-max-width-sm) {
5452
.response-display {
5553
width: 100%;
5654

5755
.preview-display {
58-
padding: map-get($spacers, 1) 0;
56+
padding: var(--pgn-spacing-spacer-1) 0;
5957
}
6058
}
61-
}
59+
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
@import "@openedx/paragon/scss/core/core";
2-
31
// action reviews
42
.review-actions {
5-
padding: map_get($spacers, 3);
3+
padding: var(--pgn-spacing-spacer-3);
64
flex-direction: row;
7-
background-color: $light-200;
5+
background-color: var(--pgn-color-light-200);
86

97
.review-actions-username {
108
flex-grow: 1;
119
}
1210
.review-actions-status {
13-
margin-left: map_get($spacers, 3);
11+
margin-left: var(--pgn-spacing-spacer-3);
1412
vertical-align: middle;
1513
}
1614
.review-actions-group {
@@ -20,18 +18,18 @@
2018

2119
.submission-navigation {
2220
float: right;
23-
padding: map-get($spacers, 1);
21+
padding: var(--pgn-spacing-spacer-1);
2422
}
2523
}
2624
}
2725

28-
@include media-breakpoint-down(md) {
26+
@media (--pgn-size-breakpoint-max-width-md) {
2927
.review-actions {
3028
flex-direction: column;
3129
align-items: flex-start !important;
3230
}
3331

3432
.review-actions-username {
35-
padding-bottom: map-get($spacers, 3);
33+
padding-bottom:var(--pgn-spacing-spacer-3);
3634
}
37-
}
35+
}

src/containers/ReviewModal/ReviewModal.scss

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
@import "@openedx/paragon/scss/core/core";
2-
31
.review-modal-body {
4-
background-color: $gray-300 !important;
2+
background-color: var(--pgn-color-gray-300) !important;
53
overflow: auto !important;
64
padding: inherit;
75

@@ -20,7 +18,7 @@
2018
}
2119
}
2220

23-
@include media-breakpoint-down(sm) {
21+
@media (--pgn-size-breakpoint-max-width-sm) {
2422
.review-modal-body {
2523
padding: 0 !important;
2624
overflow: hidden !important;

src/containers/Rubric/Rubric.scss

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
@import "~@edx/brand/paragon/variables";
2-
@import "~@openedx/paragon/scss/core/core";
3-
@import "~@edx/brand/paragon/overrides";
4-
51
.criteria-label {
62
width: 100%;
73
.criteria-title {
84
display: inline-block;
95
max-width: calc(100% - 44px);
10-
color: $primary-500;
6+
color: var(--pgn-color-primary-500);
117
font-weight: bold;
128
vertical-align: top;
139
}
1410
.esg-help-icon {
1511
float: right;
16-
margin-top: (map-get($spacers, 2) * -1);
17-
margin-right: (map-get($spacers, 2\.5) * -1);
12+
margin-top: calc(var(--pgn-spacing-spacer-2) * -1);
13+
margin-right: calc(var(--pgn-spacing-spacer-2-5) * -1);
1814
vertical-align: top;
1915
}
2016
}
@@ -38,9 +34,9 @@
3834

3935
.popover.overlay-help-popover {
4036
z-index: 4000;
41-
margin-right: map-get($spacers, 1) !important;
37+
margin-right: var(--pgn-spacing-spacer-1) !important;
4238
.help-popover-option {
43-
margin-bottom: map-get($spacers, 1);
39+
margin-bottom: var(--pgn-spacing-spacer-1);
4440
}
4541
}
4642

@@ -49,15 +45,15 @@
4945
width: 320px !important;
5046
height: fit-content;
5147
max-height: 100%;
52-
margin-left: map-get($spacers, 3);
48+
margin-left: var(--pgn-spacing-spacer-3);
5349
position: sticky !important;
54-
top: map-get($spacers, 1) * -1;
50+
top: calc(var(--pgn-spacing-spacer-1) * -1);
5551

5652
.grading-rubric-header {
5753
box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.3) !important;
5854
display: flex;
5955
justify-content: center;
60-
padding: map-get($spacers, 3);
56+
padding: var(--pgn-spacing-spacer-3);
6157
}
6258

6359
.grading-rubric-body {
@@ -68,16 +64,16 @@
6864
box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.3) !important;
6965
display: flex;
7066
justify-content: center;
71-
padding: map-get($spacers, 3);
67+
padding: var(--pgn-spacing-spacer-3);
7268
}
7369

7470
button.pgn__stateful-btn.pgn__stateful-btn-state-pending {
7571
opacity: .4 !important;
7672
}
7773
}
7874

79-
@include media-breakpoint-down(sm) {
75+
@media (--pgn-size-breakpoint-max-width-sm) {
8076
.grading-rubric-card {
8177
margin-left: 0 !important;
8278
}
83-
}
79+
}

0 commit comments

Comments
 (0)