What is tailwind-config-viewer?
The tailwind-config-viewer npm package is a tool that allows developers to visualize their Tailwind CSS configuration. It provides a web interface to explore the configuration settings, making it easier to understand and debug the Tailwind setup.
What are tailwind-config-viewer's main functionalities?
Start the Viewer
This command starts the Tailwind Config Viewer server, which opens a web interface to visualize the Tailwind CSS configuration. The interface provides a detailed view of the theme, variants, and plugins defined in the Tailwind configuration file.
npx tailwind-config-viewer
Custom Configuration Path
This command allows you to specify a custom path to your Tailwind CSS configuration file. This is useful if your configuration file is not located in the default path.
npx tailwind-config-viewer --config ./path/to/tailwind.config.js
Port Configuration
This command allows you to specify a custom port for the Tailwind Config Viewer server. By default, it runs on port 3000, but you can change it to any available port.
npx tailwind-config-viewer --port 8080
Other packages similar to tailwind-config-viewer
tailwindcss-debug-screens
tailwindcss-debug-screens is a plugin for Tailwind CSS that adds a debug screen to your application, showing the current screen size and breakpoint. While it provides useful debugging information, it does not offer the comprehensive configuration visualization that tailwind-config-viewer does.
tailwindcss-plugins
tailwindcss-plugins is a collection of plugins for Tailwind CSS that extend its functionality. While it enhances the capabilities of Tailwind CSS, it does not provide a visualization tool for the configuration like tailwind-config-viewer.
Tailwind Config Viewer
Tailwind Config Viewer is a local UI tool for visualizing your Tailwind CSS configuration file. Keep it open during development to quickly reference custom Tailwind values/classes. Easily navigate between sections of the configuration and copy class names to your clipboard by clicking on them.
Installation
NPX
Run npx tailwind-config-viewer
from within the directory that contains your Tailwind configuration file.
Globally
npm i tailwind-config-viewer
Locally
npm i tailwind-config-viewer -D
Usage
Run the tailwind-config-viewer
command from within the directory that contains your Tailwind configuration file.
Options
There are a few options you can provide to the tailwind-config-viewer
command.
Option | Default | Description |
---|
-p, --port | 3000 | The port to run the viewer on. If occupied it will use next available port. |
-o, --open | false | Open the viewer in default browser |
-c, --config | tailwind.config.js | Path to your Tailwind config file |
Roadmap