Skip to content

Commit

Permalink
Bugfix: Changing module purpose to other made icon background white i…
Browse files Browse the repository at this point in the history
…nstead of grey, solves #333. (#334)
  • Loading branch information
abias authored Jul 8, 2023
1 parent a55c9d0 commit b674193
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Unreleased

* 2023-07-07 - Bugfix: Changing module purpose to "other" made icon background white instead of grey, solves #333.
* 2023-07-07 - Bugfix: Changing module purpose to "other" made icon invisible, solves #319.
* 2023-06-26 - Bugfix: If the settings blockregionoutsiderightwidth or blockregionoutsiderightwidth were not set for any reason, the SCSS was not compiled, solves #325.

Expand Down
9 changes: 8 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,14 @@ function theme_boost_union_get_extra_scss($theme) {
// Add CSS to modify the activity purpose color in the activity chooser and the activity icon.
$content .= '.activity.modtype_'.$modname.' .activityiconcontainer.courseicon,';
$content .= '.modchoosercontainer .modicon_'.$modname.'.activityiconcontainer { ';
$content .= 'background-color: var(--activity'.$theme->settings->{$configname}.') !important;';
// If the purpose is now different than 'other', change the background color to the new color.
if ($theme->settings->{$configname} != MOD_PURPOSE_OTHER) {
$content .= 'background-color: var(--activity' . $theme->settings->{$configname} . ') !important;';

// Otherwise, the background color is set to light grey (as there is no '--activityother' variable).
} else {
$content .= 'background-color: $light !important;';
}
// If the default purpose originally was 'other' and now is overridden, make the icon white.
if ($defaultpurpose == MOD_PURPOSE_OTHER) {
$content .= '.activityicon { filter: brightness(0) invert(1); }';
Expand Down

0 comments on commit b674193

Please sign in to comment.