as we are working on a own child theme for Boost, we encountered following two problems concerning SCSS variables:
1. admin_setting_configcheckbox with default values are not written to SCSS file
If you create a checkbox admin setting with its default values (no = '0', yes = '1'), and write it to the function
this value will NOT be processed to the SCSS file.
This is because of the statement if (!empty($value)) in the following code within the same function:
Values with 0 as int or string will also return true in the emtpy() function and therefore the processing will be skipped.
This breaks the SCSS if a user checks on
because this variable simply does not exist in this case.
A solution in core could be to check on
instead of doing the check with the empty()-function.
2. Updating theme with new settings that write variables to SCSS breaks the SCSS during the database update process When you install a new version of a theme containing new settings that are transferred to SCSS variables (similar to $brand-primary), the update wizard requests to update your database. Doing this will also clear the cache and the SCSS will be built from scratch. In this SCSS file the code in which the new variables will be checked is already there. However, those variables are not yet written to the file because in that moment the setting does not yet exist. This leads to the error message that the used variable is not defined and breaks the whole SCSS. A workaround for the moment is to additionally check if the variable exists at all in the SCSS:
Nevertheless, I wanted to hint to this problem and it would be great if this could somehow be fixed in core.
Best regards, Kathrin