pegasus
Well-known member
I am attempting to use xf-default with multiple fallback values:
If my custom content-color is empty, use contentBase's color; if that's empty, use textColor; if that's empty use a hard-coded color.
My LESS template is currently similar to the following:
Expected result, something like:
However, the resulting output is more like:
with the raw xf-defaults showing like that.
And I have tried nesting the xf-defaults directly:
The result was the same.
I have also tried having all the fallback values in a single xf-default:
Which showed as:
What is the correct way to achieve this, or is this a bug?
If my custom content-color is empty, use contentBase's color; if that's empty, use textColor; if that's empty use a hard-coded color.
My LESS template is currently similar to the following:
Code:
@_contentColorCustom: xf-default(@xf-my_content--color, @xf-contentBase--color);
@_contentColorText: xf-default(@_contentColorCustom, @xf-textColor);
@_contentColor: xf-default(@_contentColorText, #000000);
.test {
color: @_contentColor;
}
Code:
.test {
color: #141414;
}
However, the resulting output is more like:
Code:
.test {
color: xf-default(xf-default(#141414, #141414), #000000);
}
And I have tried nesting the xf-defaults directly:
Code:
@_contentColor: xf-default(xf-default(xf-default(@xf-my_content--color, @xf-contentBase--color), @xf-textColor), #000000);
I have also tried having all the fallback values in a single xf-default:
Code:
@_contentColor: xf-default(@xf-my_content--color, @xf-contentBase--color, @xf-textColor, #000000);
Code:
.test {
color: #141414, #141414, #000000;
}
What is the correct way to achieve this, or is this a bug?