Tailwind Preview is a Visual Studio Code extension designed to enhance your workflow when working with Tailwind CSS. It provides a live preview of your HTML code, including Tailwind CSS, allowing you to see changes in real-time as you work.
You can install the Tailwind Preview extension directly from the Visual Studio Code Marketplace. Just search for "Tailwind Preview" in the Extensions view (Ctrl+Shift+X).
tailwind-preview.startServer
command from the Command Palette (Ctrl+Shift+P). This will start the preview server.tailwind-preview.stopServer
command from the Command Palette. If the Workspace is closed, the server will stop automatically.Make sure to run Tailwind CSS with the --watch
option. The CSS file specified in the settings will be watched for changes and will trigger a live update when modified.
{
"cssPath": "./style.css",
"port": 7937,
"openBrowser": true,
"assetPaths": {}
}
Setting | Description |
---|---|
cssPath | The location of the Tailwind CSS file, relative to the workspace folder. |
port | The default port to run the application on. |
openBrowser | If set to true, the browser will automatically open when the server starts. |
assetPaths | A key-value object containing paths to mount. |
Please report any issues you encounter on the GitHub repository.
Contributions are welcome! Please submit a pull request on the GitHub repository.