Skip to content

Commit

Permalink
Merge pull request #1055 from drgrice1/checkbox-feedback-styles-focus…
Browse files Browse the repository at this point in the history
…ed-alt2

Improve input feedback styles and add focus style to checkboxes.
  • Loading branch information
pstaabp authored Apr 17, 2024
2 parents aaf9d37 + 819e9c2 commit d115315
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions htdocs/js/MathQuill/mqeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
// Find the preview button container, and add the equation editor button to that.
const buttonContainer = document.getElementById(`${answerLabel}-latexentry-button-container`);
if (buttonContainer) {
buttonContainer.classList.add('d-flex', 'gap-1');
buttonContainer.classList.add('d-flex', 'gap-2');
buttonContainer.prepend(button);
innerContainer.append(buttonContainer);
} else {
Expand All @@ -146,7 +146,7 @@

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

let blinkInterval;
Expand Down Expand Up @@ -221,7 +221,7 @@
'pt-0',
'pb-2',
'px-2',
'gap-1',
'gap-2',
'bg-white',
'border-top-0'
);
Expand Down
4 changes: 2 additions & 2 deletions htdocs/js/MathView/mathview.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
// Find the preview button container, and wrap it in the inner container.
const buttonContainer = container.nextElementSibling;
if (buttonContainer && buttonContainer.classList.contains('latexentry-button-container')) {
buttonContainer.classList.add('d-flex', 'justify-content-end', 'gap-1');
buttonContainer.classList.add('d-flex', 'justify-content-end', 'gap-2');
buttonContainer.append(this.button);
innerContainer.append(buttonContainer);
} else {
Expand Down Expand Up @@ -171,7 +171,7 @@
inputGroup.append(this.inputTextBox);

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

const insertButton = document.createElement('button');
insertButton.type = 'button';
Expand Down
17 changes: 9 additions & 8 deletions htdocs/js/Problem/problem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,27 @@
span[id^='mq-answer'],
.graphtool-container {
&.correct:not(:focus):not(.mq-focused) {
border-color: rgba(81, 153, 81, 1); /* green */
border-color: rgba(81, 153, 81, 0.8); /* green */
outline: 0;
box-shadow:
inset 0 0 2px 1px rgba(0, 0, 0, 0.25),
0 0 8px 2px rgba(81, 153, 81, 1);
0 0 0 0.2rem rgba(81, 153, 81, 0.5);
}

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

&.partially-correct:not(:focus):not(.mq-focused) {
border-color: rgba(255, 193, 7, 1); /* yellow */
outline: 0;
box-shadow:
inset 0 0 2px 1px rgba(0, 0, 0, 0.25),
0 0 8px 2px rgba(255, 193, 7, 1);
0 0 0 0.2rem rgba(255, 193, 7, 0.8);
}
}

Expand All @@ -116,14 +116,15 @@

input[type='text'],
input[type='radio'],
input[type='checkbox'],
textarea,
select {
&:focus {
border-color: rgba(82, 168, 236, 0.8);
border-color: rgba(112, 154, 192, 0.8);
outline: 0;
box-shadow:
inset 0 1px 1px rgba(0, 0, 0, 0.075),
0 0 8px 2px rgba(82, 168, 236, 0.6);
inset 0 1px 1px rgba(0, 0, 0, 0.25),
0 0 0 0.2rem rgba(136, 187, 221, 0.8);
}
}

Expand Down
4 changes: 2 additions & 2 deletions macros/PG.pl
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ =head2 ENDDOCUMENT
=item *
C<btnAddClass>: This is a string containing additional space separated CSS
classes to add to the feedback button. This is "ms-1" by default. Macros can
classes to add to the feedback button. This is "ms-2" by default. Macros can
change this to affect positioning of the button. This generally should not be
used to change the appearance of the button.
Expand Down Expand Up @@ -1037,7 +1037,7 @@ sub ENDDOCUMENT {
resultTitle => maketext('Answer Preview'),
resultClass => '',
btnClass => 'btn-info',
btnAddClass => 'ms-1',
btnAddClass => 'ms-2',
feedbackElements => Mojo::Collection->new,
insertElement => undef,
insertMethod => 'append', # Can be append, append_content, prepend, or prepend_content.
Expand Down
2 changes: 1 addition & 1 deletion macros/core/PGessaymacros.pl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ sub NAMED_ESSAY_BOX {
)
. tag(
'div',
class => 'latexentry-button-container d-flex gap-1 mt-1',
class => 'latexentry-button-container d-flex gap-2 mt-2',
id => "$name-latexentry-button-container",
data_feedback_insert_element => $name,
tag(
Expand Down

0 comments on commit d115315

Please sign in to comment.