Skip to content

Commit f09cedf

Browse files
committed
Migrate theming from subjects.scss to relevant files
1 parent af1abd7 commit f09cedf

File tree

8 files changed

+97
-139
lines changed

8 files changed

+97
-139
lines changed

src/scss/phy/button.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ a.btn {
331331
}
332332

333333
.quick-question-options {
334-
background: rgba($secondary, 0.5);
334+
background: color-mix(in srgb, var(--subject-color-500) 50%, transparent);
335335
border: 1px solid transparent;
336336
transition: opacity 0.2s linear;
337337
}

src/scss/phy/color-theme.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
--subject-color-800: #{map.get($subject-colors, 800)};
5656
--subject-color-900: #{map.get($subject-colors, 900)};
5757

58+
// ALERT
59+
--alert-text-color: #{map.get($subject-colors, 900)};
60+
5861
@if $palette == "neutral" {
5962
// neutral has some special cases
6063
--badges-light: #{$color-neutral-white};
@@ -69,6 +72,8 @@
6972
--nav-primary: #{$color-brand-500};
7073

7174
--icon-primary: #{$color-brand-500};
75+
76+
--alert-text-color: #{$color-neutral-800};
7277
}
7378
}
7479
}
@@ -112,5 +117,28 @@
112117
@include svg-color(url("/assets/phy/icons/redesign/hexagon.svg"), var(--subject-color-200), 75px, 75px, 75px);
113118
position: absolute;
114119
}
120+
121+
.text-bg-theme {
122+
@extend .text-bg-#{$palette};
123+
}
124+
125+
.alert-secondary {
126+
@extend .alert-#{$palette};
127+
color: var(--alert-text-color);
128+
}
115129
}
116130
}
131+
132+
.text-theme {
133+
color: var(--subject-color-500);
134+
135+
&a {
136+
&:hover, &:focus {
137+
color: var(--subject-color-600);
138+
}
139+
}
140+
}
141+
142+
.border-theme {
143+
border-color: var(--subject-color-500);
144+
}

src/scss/phy/forms.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,25 @@
4444
.search--filter-input {
4545
border: 1px solid $color-neutral-300;
4646
}
47+
48+
.form-check-input {
49+
width: 24px;
50+
height: 24px;
51+
transition: all 0.1s ease-in-out;
52+
outline: none;
53+
box-shadow: none;
54+
&:checked {
55+
border-color: var(--subject-color-500);
56+
background-color: var(--subject-color-500);
57+
}
58+
&:focus {
59+
border-color: var(--subject-color-500);
60+
&:checked {
61+
box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--subject-color-500) 25%, transparent);
62+
}
63+
}
64+
&:not(:disabled):active {
65+
background-color: color-mix(in srgb, var(--subject-color-500) 25%, transparent);
66+
border-color: color-mix(in srgb, var(--subject-color-500) 25%, transparent);
67+
}
68+
}

src/scss/phy/hints.scss

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
@include respond-below(xs) {padding-left: 0 !important; padding-right: 0 !important;}
88
}
99

10-
// Note: Colours are practically always overridden by subjects.scss.
11-
// The following rule sets the default to be physics purple.
1210
li {
1311
.hint-tab-title {
14-
color: $phy_physics !important;
12+
color: var(--subject-color-500) !important;
1513
}
1614
&.active {
1715
.hint-tab-title {
1816
color: white !important;
19-
background-color: $phy_physics !important;
17+
background-color: var(--subject-color-500) !important;
2018
}
2119
}
22-
}
20+
}
2321
}

src/scss/phy/isaac.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ $theme-colors-border-subtle: map-merge($theme-colors-border-subtle, $custom-colo
396396
@import "../common/scroll-button";
397397

398398
// Pages
399-
@import "subjects";
400399
@import "../common/pages";
401400
@import "homepage";
402401
@import "../common/login";

src/scss/phy/questions.scss

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,42 @@
118118
border: solid 1px $black;
119119
}
120120
}
121+
122+
.validation-response-panel {
123+
.question-response {
124+
font-family: desyrel, serif;
125+
font-size: 36px;
126+
font-weight: 600;
127+
}
128+
h1 {
129+
font-family: desyrel, serif;
130+
font-size: 48px;
131+
font-weight: 700;
132+
}
133+
&.correct {
134+
background: var(--subject-color-500);
135+
color: white;
136+
a {
137+
color: white !important;
138+
}
139+
}
140+
&.almost {
141+
background: #ffb847;
142+
color: #3c0000;
143+
}
144+
}
145+
146+
.numeric-question .unit-selection {
147+
.display-unit {
148+
opacity: 1 !important;
149+
}
150+
.dropdown-item {
151+
&:active {
152+
background-color: var(--subject-color-500);
153+
color: white;
154+
}
155+
&:focus {
156+
box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--subject-color-500) 25%, transparent);
157+
}
158+
}
159+
}

src/scss/phy/search.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
.searchContextPicker {
44
margin-right: -0.75rem;
55
}
6+
7+
svg.search-item-icon, svg.gameboard-item-icon {
8+
fill: var(--subject-color-500);
9+
}

src/scss/phy/subjects.scss

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)