[Bug Report] Incorrect use of CSS variables inside `linear-gradient`

:lady_beetle: [Bug Report] Incorrect use of CSS variables inside linear-gradient

:books: Challenge Name:

(Replace this with the actual challenge name, e.g., “Applied Visual Design: Create a Visual Balance Using the CSS Transform Property”)


:puzzle_piece: Issue:

In the provided example or solution, the following code is used:

css

CopyEdit

background: linear-gradient(--building-color1, --window-color1);

This is incorrect because CSS variables must be used with the var() function. Writing them directly like --building-color1 inside a linear-gradient() will not work and results in a broken or missing background.


:white_check_mark: Correct Code:

css

CopyEdit

background: linear-gradient(var(--building-color1), var(--window-color1));

This is the valid syntax that properly uses the custom properties in a gradient.


:light_bulb: Why This Matters:

Incorrect usage of CSS variables can confuse beginners. In this case, the gradient won’t render at all, making it harder to understand how CSS variables and gradients work together.

please provide the page where this bug happens

it’s on step 40 in learn css variables by building a city skyline

Please do not post AI generated content on the forum

thank you, I will check it out. Now please keep in mind that posting AI generated content is against the rules

I do not find the code you posted in the page you indicated, can you point out where it is in more details?