Css variables - using the var () function with rgba and percentages and deg


please see

how do i code var(–color-light-blue)

and var (–color-dark-blue)


background: linear-gradient(45deg, rgba(153,176,233,1) 35%, rgba(0,151,255,1) 72%);

the percentages and and 45deg are throwing me off:(

not sure how to write the proper code…

proper syntax

how should these be written to work?

also, please,

if i want my css vaiables site wide, do i code the :root and all css variables in a external style sheet then link every page of my project to that style sheet?

see what i mean??


background: linear-gradient(45deg, var(--color-light-blue) 35%, var(--color-dark-blue) 72%);

You do not need to use an external style sheet. You could declare the variables for each web page.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.