This extension for Visual Studio Code simplifies working with design tokens defined in the theme.json
file used by WordPress themes. It solves the problem of having to constantly refer back to your theme.json
file for design token names, as well as having to remember all of the prefixes WordPress uses for different settings when they get converted to CSS Custom Properties.
- Automatically finds any
theme.json
files in your workspace. If multiple files are detected, you'll be asked to select atheme.json
file to use for autosuggestions. In a future version this extension will automatically find thetheme.json
file nearest to the file you're working in. - Updates suggestions whenever
theme.json
is saved. - Provides property value details in suggestions so that you can see what values are set in
theme.json
at a glance
The extension can be installed in two ways: manually via the .vsix
file included in all releases, and through the Extension Marketplace
This extension will only work inside of a folder or file workspace.
This extension contributes the following settings:
wordpressThemeJsonCssAutosuggest.enable
: Enable/disable this extension.wordpressThemeJsonCssAutosuggest.themeJsonPath
: The path to the theme directory. Leave blank to use the workspace root.
- Currently, the only way to change which
theme.json
file to use in a multi-theme workspace is to clear outwordpressThemeJsonCssAutosuggest.themeJsonPath
manually.