Paul Karkoska
Paul Karkoska

Reputation: 463

How to disable CSS errors for HTML files using Visual Studio Code (on Mac)

I am using Visual Studio Code (on a Mac) to write AngularJS style HTML. When I insert an inline expression for a CSS value, I get the annoying red Intellisense error, as shown in the screenshot below. Also, please note that I have disabled all extensions to ensure that none were the cause of my issue.

The main question is this: how do I disable the CSS errors in VSCode for Mac?

CSS Error in VSCode

Thanks for any suggestions!

Upvotes: 5

Views: 5873

Answers (2)

Hussain Pettiwala
Hussain Pettiwala

Reputation: 1684

open your settings.json file by cmd+shift+p OR crl+shift+p and typing setting.json

in that file add this line

"html.validate.styles": false

Upvotes: 7

Paul Karkoska
Paul Karkoska

Reputation: 463

VSCode is still very new to me, but after some tinkering I found an option that disables all CSS validation rules. I set the value to false and the errors are now longer showing up. The setting in your settings.json file should appear as as follows:

    {
        "folders": [
            {
                "path": "/Users/Paulie/Desktop/AngularPractice"
            }
        ],
        "settings": {
            "css.validate": false
        }
    }

Upvotes: 3

Related Questions