Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual studio code error ) expected css-rparentexpected version 1.62.2?

after updating VSC to version 1.62.2 there was a problem, swears at this syntax

 @media screen and (max-width: $tablet - 1px) {
    margin-bottom: vw($mobile, 35px);
  }

$ tablet contains 830 digits. The problem is the minus! Swears at him. Before everything was ok! There are many such lines in the project.

in the terminal console on the problems tab, the list with these errors ") expected" The detailed text of each error is approximately the same:

[{
    "resource": "",
    "owner": "_generated_diagnostic_collection_name_#0",
    "code": "css-rparentexpected",
    "severity": 8,
    "message": ") expected",
    "source": "scss",
    "startLineNumber": 278,
    "startColumn": 43,
    "endLineNumber": 278,
    "endColumn": 44
}]

Please tell me how to cure this in the new version of the VSC? It is desirable on the software side, it is not desirable to edit the SCSS code in the project, there are a lot of lines, and everything works and worked always, only the highlighting in red and the presence of errors in the console is now saddening.

enter image description here

like image 823
Cheizer Avatar asked Apr 24 '26 06:04

Cheizer


1 Answers

You should add parentheses around math expression:

(max-width: ($tablet - 1px)) 
like image 168
Nata Avatar answered May 01 '26 16:05

Nata



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!