Skip to content

Commit d11bb91

Browse files
authored
Teacher Tool Theme Fixes (#10481)
This fixes some issues with the teacher tool UI after themes were introduced. While doing this, I decided to fully swap out the themepack with our new theme variables, just to keep things consistent across the apps. It should also make things "just work" if we introduce other themes for teacher tool (though I haven't done that in this change). Since I didn't want to introduce new theme colors, I have had to make some minor adjustments to how things look (like the beta tag & toasts), but I tried to stay relatively true to the original designs.
1 parent e6c44c7 commit d11bb91

31 files changed

+290
-227
lines changed

react-common/styles/profile/UserAvatarDropdown.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
width: 2.5rem;
2222
height: 2.5rem;
2323

24-
background-color: var(--pxt-headerbar-accent);
24+
background-color: var(--pxt-header-stencil);
25+
color: var(--pxt-header-foreground);
2526
}

teachertool/src/components/CriteriaResultEntry.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const CriteriaResultToolbarTray: React.FC<{ criteriaId: string }> = ({ criteriaI
105105
}
106106
}
107107

108+
const evalDisabled = !isProjectLoaded(teacherTool);
108109
return (
109110
<div className={classList(css["result-toolbar-tray"], "no-print")}>
110111
<Button
@@ -114,11 +115,11 @@ const CriteriaResultToolbarTray: React.FC<{ criteriaId: string }> = ({ criteriaI
114115
onClick={handleDeleteClickedAsync}
115116
/>
116117
<Button
117-
className={classList("secondary", css["control-button"], css["result-toolbar-button"])}
118+
className={classList("secondary", css["control-button"], css["result-toolbar-button"], evalDisabled ? css["disabled"] : "")}
118119
rightIcon="fas fa-play"
119120
title={Strings.Evaluate}
120121
onClick={handleEvaluateClickedAsync}
121-
disabled={!isProjectLoaded(teacherTool)}
122+
disabled={evalDisabled}
122123
/>
123124
</div>
124125
);

teachertool/src/components/Toasts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const ToastNotification: React.FC<IToastNotificationProps> = ({ toast }) => {
4545

4646
return (
4747
<div className={classList(css["toast"], css[toast.type], toast.className)}>
48-
<div className={css["toast-content"]}>
48+
<div className={classList(css["toast-content"], css[toast.type])}>
4949
{!toast.hideIcon && (
5050
<div className={classList(css["icon-container"], css[toast.type])}>
5151
{toast.icon ?? icons[toast.type]}
@@ -68,7 +68,7 @@ const ToastNotification: React.FC<IToastNotificationProps> = ({ toast }) => {
6868
)}
6969
</div>
7070
{toast.timeoutMs && (
71-
<div>
71+
<div className={classList(css["slider-container"], css[toast.type])}>
7272
<div
7373
ref={sliderRef}
7474
className={classList(css["slider"], css[toast.type])}

teachertool/src/components/styling/BlockPickerModal.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.block-picker-modal {
22
div[class="common-modal"] {
33
// category color is overridden in BlockPicker javascript
4-
--category-color: var(--pxt-content-secondary-foreground);
4+
--category-color: var(--pxt-neutral-background3);
55

66
height: 80vh;
77

@@ -11,7 +11,7 @@
1111
padding: 0;
1212

1313
.bottom-border {
14-
border-bottom: 2px solid var(--pxt-content-accent);
14+
border-bottom: 2px solid var(--pxt-target-background1-hover);
1515
}
1616

1717
.loading-container {

teachertool/src/components/styling/CatalogOverlay.module.scss

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
width: 100%;
66
height: 100%;
77
z-index: 49; // Above everything except toasts
8-
background-color: var(--pxt-page-dark-shadow);
9-
10-
color: var(--pxt-page-foreground);
8+
background-color: var(--pxt-neutral-alpha50);
9+
color: var(--pxt-neutral-foreground1);
1110

1211
display: flex;
1312
justify-content: center;
@@ -16,7 +15,7 @@
1615
.catalog-content-container {
1716
width: 95%;
1817
height: 95%;
19-
background-color: var(--pxt-page-background);
18+
background-color: var(--pxt-neutral-background1);
2019
border-radius: .285rem; // Match modal
2120
display: flex;
2221
flex-direction: column;
@@ -28,7 +27,7 @@
2827
justify-content: space-between;
2928
align-items: center;
3029
width: 100%;
31-
border-bottom: 1px solid var(--pxt-content-accent);
30+
border-bottom: 1px solid var(--pxt-neutral-stencil1);
3231
height: 4rem;
3332

3433
.title {
@@ -40,6 +39,8 @@
4039
.close-button {
4140
height: 100%;
4241
padding: 0 1rem;
42+
background-color: var(--pxt-neutral-background1);
43+
color: var(--pxt-neutral-foreground1);
4344

4445
i {
4546
font-size: 1.3rem;
@@ -64,24 +65,34 @@
6465
}
6566

6667
button[class*="common-accordion-header-outer"] {
67-
background-color: var(--pxt-content-foreground);
68-
color: var(--pxt-content-background);
69-
border-bottom: 1px solid var(--pxt-content-accent);
68+
background-color: var(--pxt-tertiary-background);
69+
color: var(--pxt-tertiary-foreground);
70+
border-bottom: 1px solid var(--pxt-neutral-background1);
7071
font-size: 1.2rem;
7172
padding: 0.5rem 0.95rem;
7273
}
7374

7475
.catalog-item {
7576
width: 100%;
7677
padding: 1.25rem 1.5rem 1.25rem 1rem;
77-
border-bottom: 1px solid var(--pxt-content-accent);
78+
border-bottom: 1px solid var(--pxt-target-stencil1);
7879
flex-shrink: 0;
7980
margin: 0;
81+
background-color: var(--pxt-neutral-background1);
82+
color: var(--pxt-neutral-foreground1);
83+
84+
&:hover {
85+
background-color: var(--pxt-neutral-background1-hover);
86+
}
8087

8188
&:last-child {
8289
border-bottom: none;
8390
}
8491

92+
&[class*="disabled"] {
93+
border-color: var(--pxt-neutral-alpha20) !important
94+
}
95+
8596
.catalog-item-label {
8697
display: flex;
8798
flex-direction: row;
@@ -106,7 +117,7 @@
106117
}
107118

108119
.recently-added-indicator {
109-
color: var(--pxt-success-accent);
120+
color: var(--pxt-colors-green-background);
110121
}
111122
}
112123
}

teachertool/src/components/styling/ChecklistPreview.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
width: 100%;
99
font-weight: bold;
1010
margin-bottom: 0.1rem;
11-
border-bottom: 1px solid var(--pxt-content-foreground);
11+
border-bottom: 1px solid var(--pxt-tertiary-background);
1212
padding: 0.2rem 0.5rem;
1313
}
1414

1515
.checklist-criteria {
1616
width: 100%;
1717
padding: 0.2rem 0.5rem;
18-
border-bottom: 1px solid var(--pxt-content-accent);
18+
border-bottom: 1px solid var(--pxt-target-stencil1);
1919

2020
&:last-child {
2121
border-bottom: none;

teachertool/src/components/styling/ChecklistWorkspace.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
display: flex;
55
flex-direction: column;
66
overflow: hidden;
7-
background-color: var(--pxt-page-background);
8-
color: var(--pxt-page-foreground);
7+
background-color: var(--pxt-neutral-background1);
8+
color: var(--pxt-neutral-foreground1);
99

1010
div[class*="tt-tabgroup"] {
1111
height: 100%;

teachertool/src/components/styling/CriteriaFeedback.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
padding: 0.1rem;
1616
border-radius: 100%;
1717
background-color: transparent;
18-
color: var(--pxt-page-foreground);
18+
color: var(--pxt-neutral-foreground1);
1919
border: none;
2020
font-size: 1rem;
2121

teachertool/src/components/styling/CriteriaInstanceDisplay.module.scss

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66

77
div[class*="common-input-group"] {
88
border-radius: 0.5rem;
9-
border: solid 1px var(--pxt-page-foreground);
9+
border: solid 1px var(--pxt-neutral-foreground1);
1010
padding: 0 0.4rem;
1111

1212
&:focus::after {
1313
outline: none;
1414
border-radius: 0.5rem;
15-
border: solid 2px var(--pxt-headerbar-accent-smoke);
15+
border: solid 2px var(--pxt-neutral-alpha20);
1616
}
1717

1818
&:focus-within::after {
1919
outline: none;
2020
border-radius: 0.5rem;
21-
border: solid 2px var(--pxt-headerbar-accent-smoke);
21+
border: solid 2px var(--pxt-neutral-alpha20);
2222
}
2323
}
2424

@@ -42,7 +42,7 @@
4242
.block-input-btn {
4343
margin: 0.2rem 0;
4444
border-radius: 0.5rem;
45-
border: solid 1px var(--pxt-page-foreground);
45+
border: solid 1px var(--pxt-neutral-foreground1);
4646
padding: 0.4rem;
4747

4848
.block-readable-name {
@@ -59,8 +59,8 @@
5959
}
6060

6161
&.error {
62-
border: solid 1px var(--pxt-error-accent);
63-
background-color: var(--pxt-error-background);
62+
border: solid 1px var(--pxt-colors-red-background);
63+
background-color: var(--pxt-colors-red-alpha10);
6464
transition: background-color 0.3s ease-in-out, border 0.3s ease-in-out;
6565
padding-right: 0.6rem; // balance out with left icon
6666
}
@@ -131,20 +131,20 @@
131131

132132
&.error {
133133
&:not(:focus):not(:focus-within) div[class*="common-input-group"] {
134-
border: solid 1px var(--pxt-error-accent);
135-
background-color: var(--pxt-error-background);
134+
border: solid 1px var(--pxt-colors-red-background);
135+
background-color: var(--pxt-colors-red-alpha10);
136136
transition: background-color 0.3s ease-in-out, border 0.3s ease-in-out;
137137

138138
&:focus::after {
139-
border: solid 2px var(--pxt-error);
139+
border: solid 2px var(--pxt-colors-red-background);
140140
}
141141

142142
&:focus-within::after {
143-
border: solid 2px var(--pxt-error);
143+
border: solid 2px var(--pxt-colors-red-background);
144144
}
145145

146146
input::placeholder {
147-
color: var(--pxt-page-foreground);
147+
color: var(--pxt-neutral-foreground1);
148148
}
149149

150150
i {
@@ -166,7 +166,7 @@
166166
}
167167

168168
.criteria-description {
169-
color: var(--pxt-page-foreground-light);
169+
color: var(--pxt-neutral-alpha80);
170170
margin-top: 0.2rem;
171171
width: 100%; // For non-webkit browsers
172172
width: -webkit-fill-available; // Webkit browsers

teachertool/src/components/styling/CriteriaTable.module.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.criteria-table {
22
width: 100%;
3-
border: 1px solid var(--pxt-content-accent);
3+
border: 1px solid var(--pxt-target-background1);
44
border-radius: 0.5rem;
55
overflow: hidden;
66
margin-bottom: 1rem;
@@ -13,7 +13,7 @@
1313
display: flex;
1414
align-items: center;
1515
width: 100%;
16-
border-bottom: 1px solid var(--pxt-content-accent);
16+
border-bottom: 1px solid var(--pxt-target-background1);
1717
}
1818

1919
.criteria-display-cell {
@@ -23,7 +23,7 @@
2323
justify-content: center;
2424
text-align: left;
2525
padding: 0.5rem 0.5rem 0.5rem 0.7rem;
26-
border-right: 1px solid var(--pxt-content-accent);
26+
border-right: 1px solid var(--pxt-target-background1);
2727
}
2828

2929
.criteria-action-menu-cell {
@@ -52,7 +52,7 @@
5252
.delete-criteria-button {
5353
width: 100%;
5454
height: 100%;
55-
background-color: var(--pxt-content-background);
55+
background-color: var(--pxt-target-background1);
5656
opacity: 0; // Need opacity-based hiding (rather than display) for transitions
5757
transition: background-color 0.1s ease, opacity 0.1s ease;
5858
color: var(--black);
@@ -61,7 +61,7 @@
6161
border-radius: 0;
6262

6363
&:hover {
64-
background-color: var(--pxt-content-accent);
64+
background-color: var(--pxt-target-background1-hover);
6565
}
6666

6767
&:focus {
@@ -71,7 +71,7 @@
7171

7272
&:hover,
7373
&:focus {
74-
background-color: var(--pxt-content-background);
74+
background-color: var(--pxt-target-background1);
7575

7676
.delete-criteria-button {
7777
opacity: 1;

0 commit comments

Comments
 (0)