Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Compilation Error - Can't use variable inside hsl #555

Open
ItsMeStompy opened this issue Sep 10, 2021 · 1 comment
Open

Compilation Error - Can't use variable inside hsl #555

ItsMeStompy opened this issue Sep 10, 2021 · 1 comment

Comments

@ItsMeStompy
Copy link

I have set a variable called --color-pale to "225, 100%, 94%" so that when I put it inside a hsl tag, i can change the opacity of the color with the variable inside the hsl tag eg. background-color: hsl(var(--color-pale), .5) but when it compiles, it comes up with the error below. The css used is the second screenshot.
It could just be me being an idiot but any help would be apreciated, thanks.

Error
SCSS

@paulfm
Copy link

paulfm commented Sep 22, 2021

I am having the same problem. variables are able to hold complete color information like --variable-name: rgb(128 128 128) so that color: var(--variable-name) works but if the variable is set to --variable-2: 128 128 128; you cannot use color: rgb(var(--variable-2)); without getting a compile error about $green not being defined.

I really wish this would work to allow me to use rgba and simply pick the opacity in the code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants