This commit is contained in:
Molkobain
2022-02-19 17:18:25 +01:00
parent 3727223db3
commit fe1bf3bfc1

View File

@@ -2257,6 +2257,8 @@ EOF
}
// Retrieve colors (mandatory/optional depending on the element type)
// Note: For now we can't use CSS variables (only SCSS variables) in the style XML definition as the ibo-adjust-alpha() / ibo-adjust-lightness() used a few steps below do not support them,
// if this ever should be considered, the following article might help: https://codyhouse.co/blog/post/how-to-combine-sass-color-functions-and-css-variables#other-color-functions
if ($sElementType === self::ENUM_STYLE_HOST_ELEMENT_TYPE_CLASS) {
$sMainColorForCss = $this->GetPropString($oNode, 'main_color', null, false);
$sMainColorForOrm = $this->GetPropString($oNode, 'main_color', null);
@@ -2314,7 +2316,7 @@ EOF
$sMainColorCssVariableDeclaration = "$sMainColorCssVariableName: #{{$sMainColorScssVariableName}};";
$sCssRegularClassMainColorDeclaration = "--ibo-main-color: $sMainColorScssVariableName;";
// Note: We have to manually force the alpha chanel in case the given color is transparent
// Note: We have to manually force the alpha channel in case the given color is transparent
$sCssRegularClassMainColor100Declaration = "--ibo-main-color--100: ibo-adjust-alpha(ibo-adjust-lightness($sMainColorScssVariableName, \$ibo-color-base-lightness-100), \$ibo-color-base-opacity-for-lightness-100);";
$sCssRegularClassMainColor900Declaration = "--ibo-main-color--900: ibo-adjust-alpha(ibo-adjust-lightness($sMainColorScssVariableName, \$ibo-color-base-lightness-900), \$ibo-color-base-opacity-for-lightness-900);";