diff --git a/theme/boost/scss/moodle.scss b/theme/boost/scss/moodle.scss index 7451eeb10ac..2204b645e7b 100644 --- a/theme/boost/scss/moodle.scss +++ b/theme/boost/scss/moodle.scss @@ -50,3 +50,4 @@ $breadcrumb-divider-rtl: "◀" !default; @import "moodle/tertiarynavigation"; @import "moodle/process-monitor"; @import "moodle/moodlenet"; +@import "moodle/dropdown"; diff --git a/theme/boost/scss/moodle/core.scss b/theme/boost/scss/moodle/core.scss index d5368635e5e..43d0006892f 100644 --- a/theme/boost/scss/moodle/core.scss +++ b/theme/boost/scss/moodle/core.scss @@ -2406,40 +2406,6 @@ $footer-link-color: $bg-inverse-link-color !default; } } -// Make links in a menu clickable anywhere in the row. -.dropdown-item { - a { - display: block; - width: 100%; - color: $body-color; - } - &.active, - &:active, - &:hover, - &:focus, - &:focus-within { - outline: 0; - background-color: $dropdown-link-active-bg; - color: $dropdown-link-active-color; - a { - color: $dropdown-link-active-color; - } - } - &[aria-current="true"], - &[aria-selected="true"] { - position: relative; - display: flex; - align-items: center; - &:before { - @extend .fa-solid; - content: fa-content($fa-var-check); - position: absolute; - left: 0.4rem; - font-size: 0.7rem; - } - } -} - .competency-tree { ul { padding-left: 1.5rem; diff --git a/theme/boost/scss/moodle/dropdown.scss b/theme/boost/scss/moodle/dropdown.scss new file mode 100644 index 00000000000..8329f602d6a --- /dev/null +++ b/theme/boost/scss/moodle/dropdown.scss @@ -0,0 +1,47 @@ +/** + * Dropdown menu Moodle specific styles. + */ + +// Make links in a menu clickable anywhere in the row. +.dropdown-item { + a { + display: block; + width: 100%; + color: $body-color; + } + &.active, + &:active, + &:hover, + &:focus, + &:focus-within { + outline: 0; + background-color: $dropdown-link-active-bg; + color: $dropdown-link-active-color; + a { + color: $dropdown-link-active-color; + } + } + &[aria-current="true"], + &[aria-selected="true"] { + position: relative; + display: flex; + align-items: center; + &:before { + @extend .fa-solid; + content: fa-content($fa-var-check); + position: absolute; + left: 0.4rem; + font-size: 0.7rem; + } + } +} + +// Add dropdown menu items styles for each theme color (mantainning default hover colour for contrast). +@each $color, $value in $theme-colors { + .dropdown-item.text-#{$color} { + color: $value; + &:hover { + color: $dropdown-link-hover-color !important; /* stylelint-disable-line declaration-no-important */ + } + } +} diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 114f1d174a7..ae9f964fef3 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -2067,6 +2067,8 @@ } .fas, .fa-solid, +.dropdown-item[aria-current=true]:before, +.dropdown-item[aria-selected=true]:before, .moremenu .dropdown-item[aria-current=true]:before, .moremenu .dropdown-item.active:before, .dir-rtl .navbar.fixed-top .usermenu .dropdown-menu .dropdown-item.carousel-navigation-link::after, @@ -2086,9 +2088,7 @@ .dropup .dropdown-toggle::after, .dropright .dropdown-toggle::after, .dropleft .dropdown-toggle::before, -.dropdown-toggle::after, -.dropdown-item[aria-current=true]:before, -.dropdown-item[aria-selected=true]:before { +.dropdown-toggle::after { font-weight: 900; } @@ -4926,6 +4926,8 @@ .fa-sharp, .fas, .fa-solid, +.dropdown-item[aria-current=true]:before, +.dropdown-item[aria-selected=true]:before, .moremenu .dropdown-item[aria-current=true]:before, .moremenu .dropdown-item.active:before, .dir-rtl .navbar.fixed-top .usermenu .dropdown-menu .dropdown-item.carousel-navigation-link::after, @@ -4946,8 +4948,6 @@ .dropright .dropdown-toggle::after, .dropleft .dropdown-toggle::before, .dropdown-toggle::after, -.dropdown-item[aria-current=true]:before, -.dropdown-item[aria-selected=true]:before, .far, .fa-regular, .content-bank-container.view-grid .cb-unlisted::after, @@ -4965,6 +4965,8 @@ .fas, .fa-classic, .fa-solid, +.dropdown-item[aria-current=true]:before, +.dropdown-item[aria-selected=true]:before, .moremenu .dropdown-item[aria-current=true]:before, .moremenu .dropdown-item.active:before, .dir-rtl .navbar.fixed-top .usermenu .dropdown-menu .dropdown-item.carousel-navigation-link::after, @@ -4985,8 +4987,6 @@ .dropright .dropdown-toggle::after, .dropleft .dropdown-toggle::before, .dropdown-toggle::after, -.dropdown-item[aria-current=true]:before, -.dropdown-item[aria-selected=true]:before, .far, .fa-regular, .content-bank-container.view-grid .cb-unlisted::after { @@ -25225,31 +25225,6 @@ h3.sectionname .inplaceeditable.inplaceeditingon .editinstructions { width: 112px; } -.dropdown-item a { - display: block; - width: 100%; - color: #1d2125; -} -.dropdown-item.active, .dropdown-item:active, .dropdown-item:hover, .dropdown-item:focus, .dropdown-item:focus-within { - outline: 0; - background-color: #0f6cbf; - color: #fff; -} -.dropdown-item.active a, .dropdown-item:active a, .dropdown-item:hover a, .dropdown-item:focus a, .dropdown-item:focus-within a { - color: #fff; -} -.dropdown-item[aria-current=true], .dropdown-item[aria-selected=true] { - position: relative; - display: flex; - align-items: center; -} -.dropdown-item[aria-current=true]:before, .dropdown-item[aria-selected=true]:before { - content: "\f00c"; - position: absolute; - left: 0.4rem; - font-size: 0.7rem; -} - .competency-tree ul { padding-left: 1.5rem; } @@ -38267,6 +38242,90 @@ div.editor_atto_toolbar button .icon { margin-right: auto; } +/** + * Dropdown menu Moodle specific styles. + */ +.dropdown-item a { + display: block; + width: 100%; + color: #1d2125; +} +.dropdown-item.active, .dropdown-item:active, .dropdown-item:hover, .dropdown-item:focus, .dropdown-item:focus-within { + outline: 0; + background-color: #0f6cbf; + color: #fff; +} +.dropdown-item.active a, .dropdown-item:active a, .dropdown-item:hover a, .dropdown-item:focus a, .dropdown-item:focus-within a { + color: #fff; +} +.dropdown-item[aria-current=true], .dropdown-item[aria-selected=true] { + position: relative; + display: flex; + align-items: center; +} +.dropdown-item[aria-current=true]:before, .dropdown-item[aria-selected=true]:before { + content: "\f00c"; + position: absolute; + left: 0.4rem; + font-size: 0.7rem; +} + +.dropdown-item.text-primary { + color: #0f6cbf; +} +.dropdown-item.text-primary:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-secondary { + color: #ced4da; +} +.dropdown-item.text-secondary:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-success { + color: #357a32; +} +.dropdown-item.text-success:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-info { + color: #008196; +} +.dropdown-item.text-info:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-warning { + color: #f0ad4e; +} +.dropdown-item.text-warning:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-danger { + color: #ca3120; +} +.dropdown-item.text-danger:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-light { + color: #f8f9fa; +} +.dropdown-item.text-light:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-dark { + color: #343a40; +} +.dropdown-item.text-dark:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index de5aff49cfa..6dc834cca31 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -2067,6 +2067,8 @@ } .fas, .fa-solid, +.dropdown-item[aria-current=true]:before, +.dropdown-item[aria-selected=true]:before, .moremenu .dropdown-item[aria-current=true]:before, .moremenu .dropdown-item.active:before, .dir-rtl .navbar.fixed-top .usermenu .dropdown-menu .dropdown-item.carousel-navigation-link::after, @@ -2086,9 +2088,7 @@ .dropup .dropdown-toggle::after, .dropright .dropdown-toggle::after, .dropleft .dropdown-toggle::before, -.dropdown-toggle::after, -.dropdown-item[aria-current=true]:before, -.dropdown-item[aria-selected=true]:before { +.dropdown-toggle::after { font-weight: 900; } @@ -4926,6 +4926,8 @@ .fa-sharp, .fas, .fa-solid, +.dropdown-item[aria-current=true]:before, +.dropdown-item[aria-selected=true]:before, .moremenu .dropdown-item[aria-current=true]:before, .moremenu .dropdown-item.active:before, .dir-rtl .navbar.fixed-top .usermenu .dropdown-menu .dropdown-item.carousel-navigation-link::after, @@ -4946,8 +4948,6 @@ .dropright .dropdown-toggle::after, .dropleft .dropdown-toggle::before, .dropdown-toggle::after, -.dropdown-item[aria-current=true]:before, -.dropdown-item[aria-selected=true]:before, .far, .fa-regular, .content-bank-container.view-grid .cb-unlisted::after, @@ -4965,6 +4965,8 @@ .fas, .fa-classic, .fa-solid, +.dropdown-item[aria-current=true]:before, +.dropdown-item[aria-selected=true]:before, .moremenu .dropdown-item[aria-current=true]:before, .moremenu .dropdown-item.active:before, .dir-rtl .navbar.fixed-top .usermenu .dropdown-menu .dropdown-item.carousel-navigation-link::after, @@ -4985,8 +4987,6 @@ .dropright .dropdown-toggle::after, .dropleft .dropdown-toggle::before, .dropdown-toggle::after, -.dropdown-item[aria-current=true]:before, -.dropdown-item[aria-selected=true]:before, .far, .fa-regular, .content-bank-container.view-grid .cb-unlisted::after { @@ -25225,31 +25225,6 @@ h3.sectionname .inplaceeditable.inplaceeditingon .editinstructions { width: 112px; } -.dropdown-item a { - display: block; - width: 100%; - color: #1d2125; -} -.dropdown-item.active, .dropdown-item:active, .dropdown-item:hover, .dropdown-item:focus, .dropdown-item:focus-within { - outline: 0; - background-color: #0f6cbf; - color: #fff; -} -.dropdown-item.active a, .dropdown-item:active a, .dropdown-item:hover a, .dropdown-item:focus a, .dropdown-item:focus-within a { - color: #fff; -} -.dropdown-item[aria-current=true], .dropdown-item[aria-selected=true] { - position: relative; - display: flex; - align-items: center; -} -.dropdown-item[aria-current=true]:before, .dropdown-item[aria-selected=true]:before { - content: "\f00c"; - position: absolute; - left: 0.4rem; - font-size: 0.7rem; -} - .competency-tree ul { padding-left: 1.5rem; } @@ -38201,6 +38176,90 @@ div.editor_atto_toolbar button .icon { margin-right: auto; } +/** + * Dropdown menu Moodle specific styles. + */ +.dropdown-item a { + display: block; + width: 100%; + color: #1d2125; +} +.dropdown-item.active, .dropdown-item:active, .dropdown-item:hover, .dropdown-item:focus, .dropdown-item:focus-within { + outline: 0; + background-color: #0f6cbf; + color: #fff; +} +.dropdown-item.active a, .dropdown-item:active a, .dropdown-item:hover a, .dropdown-item:focus a, .dropdown-item:focus-within a { + color: #fff; +} +.dropdown-item[aria-current=true], .dropdown-item[aria-selected=true] { + position: relative; + display: flex; + align-items: center; +} +.dropdown-item[aria-current=true]:before, .dropdown-item[aria-selected=true]:before { + content: "\f00c"; + position: absolute; + left: 0.4rem; + font-size: 0.7rem; +} + +.dropdown-item.text-primary { + color: #0f6cbf; +} +.dropdown-item.text-primary:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-secondary { + color: #ced4da; +} +.dropdown-item.text-secondary:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-success { + color: #357a32; +} +.dropdown-item.text-success:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-info { + color: #008196; +} +.dropdown-item.text-info:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-warning { + color: #f0ad4e; +} +.dropdown-item.text-warning:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-danger { + color: #ca3120; +} +.dropdown-item.text-danger:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-light { + color: #f8f9fa; +} +.dropdown-item.text-light:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + +.dropdown-item.text-dark { + color: #343a40; +} +.dropdown-item.text-dark:hover { + color: #fff !important; /* stylelint-disable-line declaration-no-important */ +} + body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;