Skip to content

Commit

Permalink
Upgrade: Use the new -icon-* SCSS variables for the activity icon col…
Browse files Browse the repository at this point in the history
…or settings.
  • Loading branch information
abias committed Oct 27, 2023
1 parent a3e0477 commit ec0c0d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
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-10-27 - Upgrade: Use the new $activity-icon-* SCSS variables for the activity icon color settings.
* 2023-10-27 - Upgrade: Replace deprecated user_preference_allow_ajax_update() function.
* 2023-10-25 - Upgrade: Adopt changes in layout/drawers.php from Boost core.
* 2023-10-25 - Upgrade: Adopt changes in primary-drawer-mobile.mustache from Boost core.
Expand Down
34 changes: 6 additions & 28 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ function theme_boost_union_get_pre_scss($theme) {
'bootstrapcolorinfo' => ['info'],
'bootstrapcolorwarning' => ['warning'],
'bootstrapcolordanger' => ['danger'],
'activityiconcoloradministration' => ['activity-icon-administration-bg'],
'activityiconcolorassessment' => ['activity-icon-assessment-bg'],
'activityiconcolorcollaboration' => ['activity-icon-collaboration-bg'],
'activityiconcolorcommunication' => ['activity-icon-communication-bg'],
'activityiconcolorcontent' => ['activity-icon-content-bg'],
'activityiconcolorinterface' => ['activity-icon-interface-bg'],
];

// Prepend variables first.
Expand Down Expand Up @@ -170,34 +176,6 @@ function theme_boost_union_get_pre_scss($theme) {
$scss .= '$h5p-content-maxwidth: '.get_config('theme_boost_union', 'h5pcontentmaxwidth').";\n";
}

// Overwrite Boost core SCSS variables which are stored in a SCSS map and thus couldn't be added to $configurable above.
// Set variables for the activity icon colors.
$activityiconcolors = [];
if (get_config('theme_boost_union', 'activityiconcoloradministration')) {
$activityiconcolors[] = '"administration": '.get_config('theme_boost_union', 'activityiconcoloradministration');
}
if (get_config('theme_boost_union', 'activityiconcolorassessment')) {
$activityiconcolors[] = '"assessment": '.get_config('theme_boost_union', 'activityiconcolorassessment');
}
if (get_config('theme_boost_union', 'activityiconcolorcollaboration')) {
$activityiconcolors[] = '"collaboration": '.get_config('theme_boost_union', 'activityiconcolorcollaboration');
}
if (get_config('theme_boost_union', 'activityiconcolorcommunication')) {
$activityiconcolors[] = '"communication": '.get_config('theme_boost_union', 'activityiconcolorcommunication');
}
if (get_config('theme_boost_union', 'activityiconcolorcontent')) {
$activityiconcolors[] = '"content": '.get_config('theme_boost_union', 'activityiconcolorcontent');
}
if (get_config('theme_boost_union', 'activityiconcolorinterface')) {
$activityiconcolors[] = '"interface": '.get_config('theme_boost_union', 'activityiconcolorinterface');
}
if (count($activityiconcolors) > 0) {
$activityiconscss = '$activity-icon-colors: ('."\n";
$activityiconscss .= implode(",\n", $activityiconcolors);
$activityiconscss .= ');';
$scss .= $activityiconscss."\n";
}

// Set custom Boost Union SCSS variable: The block region outside left width.
$blockregionoutsideleftwidth = get_config('theme_boost_union', 'blockregionoutsideleftwidth');
// If the setting is not set.
Expand Down

0 comments on commit ec0c0d4

Please sign in to comment.