Skip to content

Commit d115315

Browse files
authored
Merge pull request #1055 from drgrice1/checkbox-feedback-styles-focused-alt2
Improve input feedback styles and add focus style to checkboxes.
2 parents aaf9d37 + 819e9c2 commit d115315

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

htdocs/js/MathQuill/mqeditor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
// Find the preview button container, and add the equation editor button to that.
138138
const buttonContainer = document.getElementById(`${answerLabel}-latexentry-button-container`);
139139
if (buttonContainer) {
140-
buttonContainer.classList.add('d-flex', 'gap-1');
140+
buttonContainer.classList.add('d-flex', 'gap-2');
141141
buttonContainer.prepend(button);
142142
innerContainer.append(buttonContainer);
143143
} else {
@@ -146,7 +146,7 @@
146146

147147
// Create a collapse to hold the editor.
148148
const collapse = document.createElement('div');
149-
collapse.classList.add('collapse', 'mt-1');
149+
collapse.classList.add('collapse', 'mt-2');
150150
collapse.id = `${answerLabel}-equation-editor`;
151151

152152
let blinkInterval;
@@ -221,7 +221,7 @@
221221
'pt-0',
222222
'pb-2',
223223
'px-2',
224-
'gap-1',
224+
'gap-2',
225225
'bg-white',
226226
'border-top-0'
227227
);

htdocs/js/MathView/mathview.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
// Find the preview button container, and wrap it in the inner container.
9595
const buttonContainer = container.nextElementSibling;
9696
if (buttonContainer && buttonContainer.classList.contains('latexentry-button-container')) {
97-
buttonContainer.classList.add('d-flex', 'justify-content-end', 'gap-1');
97+
buttonContainer.classList.add('d-flex', 'justify-content-end', 'gap-2');
9898
buttonContainer.append(this.button);
9999
innerContainer.append(buttonContainer);
100100
} else {
@@ -171,7 +171,7 @@
171171
inputGroup.append(this.inputTextBox);
172172

173173
const footer = document.createElement('div');
174-
footer.classList.add('d-flex', 'justify-content-end', 'gap-1', 'mt-2');
174+
footer.classList.add('d-flex', 'justify-content-end', 'gap-2', 'mt-2');
175175

176176
const insertButton = document.createElement('button');
177177
insertButton.type = 'button';

htdocs/js/Problem/problem.scss

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,27 @@
7373
span[id^='mq-answer'],
7474
.graphtool-container {
7575
&.correct:not(:focus):not(.mq-focused) {
76-
border-color: rgba(81, 153, 81, 1); /* green */
76+
border-color: rgba(81, 153, 81, 0.8); /* green */
7777
outline: 0;
7878
box-shadow:
7979
inset 0 0 2px 1px rgba(0, 0, 0, 0.25),
80-
0 0 8px 2px rgba(81, 153, 81, 1);
80+
0 0 0 0.2rem rgba(81, 153, 81, 0.5);
8181
}
8282

8383
&.incorrect:not(:focus):not(.mq-focused) {
84-
border-color: rgba(191, 84, 84, 1); /* red */
84+
border-color: rgba(191, 84, 84, 0.8); /* red */
8585
outline: 0;
8686
box-shadow:
8787
inset 0 0 2px 1px rgba(0, 0, 0, 0.25),
88-
0 0 8px 2px rgba(191, 84, 84, 1);
88+
0 0 0 0.2rem rgba(191, 84, 84, 0.5);
8989
}
9090

9191
&.partially-correct:not(:focus):not(.mq-focused) {
9292
border-color: rgba(255, 193, 7, 1); /* yellow */
9393
outline: 0;
9494
box-shadow:
9595
inset 0 0 2px 1px rgba(0, 0, 0, 0.25),
96-
0 0 8px 2px rgba(255, 193, 7, 1);
96+
0 0 0 0.2rem rgba(255, 193, 7, 0.8);
9797
}
9898
}
9999

@@ -116,14 +116,15 @@
116116

117117
input[type='text'],
118118
input[type='radio'],
119+
input[type='checkbox'],
119120
textarea,
120121
select {
121122
&:focus {
122-
border-color: rgba(82, 168, 236, 0.8);
123+
border-color: rgba(112, 154, 192, 0.8);
123124
outline: 0;
124125
box-shadow:
125-
inset 0 1px 1px rgba(0, 0, 0, 0.075),
126-
0 0 8px 2px rgba(82, 168, 236, 0.6);
126+
inset 0 1px 1px rgba(0, 0, 0, 0.25),
127+
0 0 0 0.2rem rgba(136, 187, 221, 0.8);
127128
}
128129
}
129130

macros/PG.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ =head2 ENDDOCUMENT
840840
=item *
841841
842842
C<btnAddClass>: This is a string containing additional space separated CSS
843-
classes to add to the feedback button. This is "ms-1" by default. Macros can
843+
classes to add to the feedback button. This is "ms-2" by default. Macros can
844844
change this to affect positioning of the button. This generally should not be
845845
used to change the appearance of the button.
846846
@@ -1037,7 +1037,7 @@ sub ENDDOCUMENT {
10371037
resultTitle => maketext('Answer Preview'),
10381038
resultClass => '',
10391039
btnClass => 'btn-info',
1040-
btnAddClass => 'ms-1',
1040+
btnAddClass => 'ms-2',
10411041
feedbackElements => Mojo::Collection->new,
10421042
insertElement => undef,
10431043
insertMethod => 'append', # Can be append, append_content, prepend, or prepend_content.

macros/core/PGessaymacros.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ sub NAMED_ESSAY_BOX {
134134
)
135135
. tag(
136136
'div',
137-
class => 'latexentry-button-container d-flex gap-1 mt-1',
137+
class => 'latexentry-button-container d-flex gap-2 mt-2',
138138
id => "$name-latexentry-button-container",
139139
data_feedback_insert_element => $name,
140140
tag(

0 commit comments

Comments
 (0)