Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Function rgb is missing argument $green in SASS

Tags:

html

css

sass

I am getting an error while writing the CSS file using SCSS
The error is as follows:

Error: Function RGB is missing in argument $green.
       on line 116 of sass/c:\Users\User\Desktop\This PC\style.scss
>>     background-color:RGB(111 197 236 / 49%);

The HTML and SCSS code are mentioned below:

.header-hover:hover{
    background-color: rgb(111 197 236 / 49%);
}
<i class="fa-solid fa-angle-right icon less header-hover"></i>

I had used font awesome to get the icons.

like image 768
Afnan Ahmad Avatar asked Sep 12 '25 18:09

Afnan Ahmad


2 Answers

sass hasn't yet caught up to the new standard so try to use rgba(111, 197, 236, 0.49); instead of rgb(111 197 236 / 49%)

like image 121
Amandeep Singh Avatar answered Sep 16 '25 06:09

Amandeep Singh


If you want to or have to use the new syntax, you can use upper case RGB instead, and sass will ignore it.

.header-hover:hover{
    background-color: RGB(111 197 236 / 49%);
}

This is especially useful when you are using CSS variables you don't control:

.header-hover:hover{
    background-color: RGB(var(--color-blue) / 49%);
}
like image 24
Jouke van der Maas Avatar answered Sep 16 '25 07:09

Jouke van der Maas