sassmonaco-editormonarch

Allow $var in Monaco Editor for sass file


I'm using the Monaco editor to edit some sass file.

I have some variables within but Monaco gives me an error : property value expectedcss(css-propertyvalueexpected)

Example of my class

Every line after my variable is on error. So far my only choices as I'm aware of is either to block all errors or leave the like this (knowing my file is working). Just blocking the css-propertyvalueexpected errors won't do good since the lines after are still on error.

I tried something like border-color: var("palette-secondary"), and while Monaco isn't showing any error, my variable is not working anymore.

How do you manage to instanciate variable for Sass in Monaco editor without getting errors ?


Solution

  • Found a workaround by declaring it as a variable :

    :root{
      --palette-secondary: #{$palette-secondary};
    }
    
    .container {
          box-shadow: none;
          border: solid 1px;
          border-color: var(--palette-secondary);
          margin:0px;
          border-radius: 0.9rem;
      }