diff --git a/lib/classes/output/choicelist.php b/lib/classes/output/choicelist.php index ae38e786329..20f6f37ebe5 100644 --- a/lib/classes/output/choicelist.php +++ b/lib/classes/output/choicelist.php @@ -169,7 +169,7 @@ class choicelist implements renderable, named_templatable { $options = []; foreach ($this->options as $option) { if (!empty($option['icon'])) { - $option['icon'] = $option['icon']->export_for_template($output); + $option['icon'] = $option['icon']->export_for_pix($output); } $option['hasicon'] = !empty($option['icon']); diff --git a/lib/templates/local/choicelist.mustache b/lib/templates/local/choicelist.mustache index 25ae0b46a77..73bd2c4a846 100644 --- a/lib/templates/local/choicelist.mustache +++ b/lib/templates/local/choicelist.mustache @@ -78,7 +78,7 @@ ] } }} -
+
{{#options}} {{> core/local/choicelist/option}} {{/options}} diff --git a/lib/templates/local/choicelist/option.mustache b/lib/templates/local/choicelist/option.mustache index ba7525fbd82..b36355ae36f 100644 --- a/lib/templates/local/choicelist/option.mustache +++ b/lib/templates/local/choicelist/option.mustache @@ -52,15 +52,10 @@ class="d-flex flex-row align-items-start p-2 mb-1 {{! }} position-relative rounded dropdown-item-outline {{! }} {{#disabled}} dimmed_text {{/disabled}} {{! - }} {{#selected}} bg-light selected {{/selected}}" + }} {{#selected}} border bg-primary-light selected {{/selected}}" data-optionnumber="{{optionnumber}}" data-selected="{{selected}}" > - {{#icon}} -
- {{>core/pix_icon}} -
- {{/icon}}
{{#pix}} i/checkedcircle, core, {{#str}} selected, form {{/str}} {{/pix}} @@ -69,11 +64,17 @@ {{#pix}} i/uncheckedcircle{{/pix}}
+ {{#icon}} +
+ {{#pix}}{{key}}, {{component}}, {{title}}{{/pix}} +
+ {{/icon}}
{{#description}} -
+
{{{description}}}
{{/description}} diff --git a/theme/boost/scss/moodle/action-menu.scss b/theme/boost/scss/moodle/action-menu.scss index caed9f2208a..e5fa45503b5 100644 --- a/theme/boost/scss/moodle/action-menu.scss +++ b/theme/boost/scss/moodle/action-menu.scss @@ -30,10 +30,6 @@ .dropdown-subpanel-content { max-width: $modal-sm; box-shadow: 0 0 1rem rgba($black, .15); - - a:focus { - outline: solid $primary; - } } .dropdown-subpanel-content.show { diff --git a/theme/boost/scss/moodle/core.scss b/theme/boost/scss/moodle/core.scss index 6e194e4fab2..91d962b809e 100644 --- a/theme/boost/scss/moodle/core.scss +++ b/theme/boost/scss/moodle/core.scss @@ -257,6 +257,10 @@ button.close, color: map-get($theme-colors, 'info'); } +.bg-primary-light { + background-color: $primary-light-background; +} + .fitem.advanced .text-info { font-weight: bold; } @@ -3178,18 +3182,11 @@ blockquote { /* Choice list component. */ .choicelist { - min-width: $modal-sm; -} + // Choicelist is designed to fit inside a small modal. + min-width: calc(#{$modal-sm} - 25px); -[data-region="fixed-drawer"] { - .choicelist { - min-width: calc(#{$modal-sm} - 25px); - } -} - -@include media-breakpoint-down(xs) { - // Modal small are larger than xs breakpoint. - .choicelist { - min-width: calc(#{$modal-sm} - 25px); + // Align the font based icons. + i.icon { + vertical-align: middle; } } diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index b2b1e706d0c..a6937acb0c8 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -23138,6 +23138,10 @@ button.close:focus:hover, color: #008196; } +.bg-primary-light { + background-color: #f5f9fc; +} + .fitem.advanced .text-info { font-weight: bold; } @@ -25985,18 +25989,12 @@ blockquote { /* Choice list component. */ .choicelist { - min-width: 300px; -} - -[data-region=fixed-drawer] .choicelist { min-width: calc(300px - 25px); } - -@media (max-width: 575.98px) { - .choicelist { - min-width: calc(300px - 25px); - } +.choicelist i.icon { + vertical-align: middle; } + .action-menu .dropdown-toggle { text-decoration: none; display: inline-block; @@ -26023,9 +26021,6 @@ blockquote { max-width: 300px; box-shadow: 0 0 1rem rgba(0, 0, 0, 0.15); } -.action-menu .dropdown-subpanel-content a:focus { - outline: solid #0f6cbf; -} .action-menu .dropdown-subpanel-content.show { animation: 0.15s animate-pop; } diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index b5c23fa266e..e9bbe18974d 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -23138,6 +23138,10 @@ button.close:focus:hover, color: #008196; } +.bg-primary-light { + background-color: #f5f9fc; +} + .fitem.advanced .text-info { font-weight: bold; } @@ -25985,18 +25989,12 @@ blockquote { /* Choice list component. */ .choicelist { - min-width: 300px; -} - -[data-region=fixed-drawer] .choicelist { min-width: calc(300px - 25px); } - -@media (max-width: 575.98px) { - .choicelist { - min-width: calc(300px - 25px); - } +.choicelist i.icon { + vertical-align: middle; } + .action-menu .dropdown-toggle { text-decoration: none; display: inline-block; @@ -26023,9 +26021,6 @@ blockquote { max-width: 300px; box-shadow: 0 0 1rem rgba(0, 0, 0, 0.15); } -.action-menu .dropdown-subpanel-content a:focus { - outline: solid #0f6cbf; -} .action-menu .dropdown-subpanel-content.show { animation: 0.15s animate-pop; }