Customize SLDS Validator
If you’re working in SLDS 2, you must turn on SLDS 2 validation in VS Code Settings. To maximize your use of SLDS Validator with SLDS 1 or SLDS 2, consider turning on other available custom settings.
You can access custom settings for SLDS Validator by either of these methods.
- Open VS Code Settings > Settings. Select SLDS Validator.
- Open the VS Code Command Palette, then search for SLDS:.
Turn on SLDS 2 recommendations by using one of these methods.
- In Settings, select Enable or disable SLDS2 validation. When selected, SLDS 2 validation is enabled.
- In Command Palette, select SLDS: Enable SLDS2 validation.
To turn off SLDS 2 validation, use one of these methods.
- In Settings, deselect Enable or disable SLDS2 validation.
- In Command Palette, select SLDS: Disable SLDS2 validation.
As you work in SLDS 2, you use styling hooks, not design tokens. To eliminate noise, turn off the design token settings by one of these methods.
- In Settings, deselect the Deprecated and Design Token settings. When checked, these settings are turned off.
- In Command Palette, select SLDS: Disable Design Token Suggestion and SLDS: Disable Deprecated Suggestion
To enhance your work with SLDS Validator, consider turning on these customizations in Settings.
- Auto Suggest. Receive suggestions automatically.
- Bem Naming. Receive BEM naming suggestions.
- Color Contrast. Detect color contrast.
- Density. Detect density tokens and classes.
- Enabled. Turn on or off SLDS Validator in VS Code.
- Invalid. Detect invalid SLDS utility classes.
- Mobile Validation. Receive SLDS validation for Salesforce mobile app.
- Override. Override the detection of SLDS utility classes.
- Scope With In SLDS. Run SLDS Validator only on Salesforce DX files.