Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why does VSCode not recognize the tilde-quote notation in my CSS file?

I am using Visual Studio Code for a pure HTML, JavaScript and CSS project. I imported a CSS file from an old project that was provided to me by a colleague and a few of the lines in the CSS file are marked as having an error in VS Code, such as this one:

.some-class .some-sub-class {
   padding-left: calc(~"50px + .75rem");
}

VS Code notes two errors here:

  • ) expected (squiggly line under the tilde)
  • at-rule or selector expected (squiggly line under the closing bracket)

I was able to determine that both errors were caused by the tilde ~ character, since removing it suppresses the errors, but I need the tilde for those CSS rules.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The file is just a .css file if that’s relevant, and simply closing it doesn’t show any error anymore.

Is there an extension I should add, remove, or configure to make that error go away?

here are the extensions I have installed so far. The issue was happening before I installed any of them:
my currently installed extensions

>Solution :

This is not valid CSS format, this seems to be LessCSS, which means you’d have to select proper filetype: Less.
enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading