Setting up PrimeVue Unstyled and Tailwind CSS presets in a Nuxt project.
The prerequisite steps are covered by the Install Tailwind CSS with Nuxt guide. You may choose to install manually or via the Tailwind module of nuxt. If you have Nuxt and Tailwind configured successfully, follow the next steps.
PrimeVue is available for download on npm registry. For this setup, we'll also use the primevue-nuxt module.
In your nuxt-config file, add the nuxt-primevue module and configure PrimeVue to be unstyled.
Download a release from github, alternatively you may use Preset Builder to dynamically build your release file with the components you need as the pre-build release package contains all the available components. Once the zip is downloaded, extract the contents to a folder of your choice e.g. ./presets and then in your nuxt-config file, configure the importPT property of PrimeVue to the main preset file.
The built-in presets utilize an extended color palette based on CSS variables that needs to be defined at tailwind.config.js. In addition, the presets folder is required to be scanned by Tailwind with the content property. If you are using the tailwind module, this can be done in a separate config file or using the nuxt config directly. Visit the overwriting the default configuration documentation for details.
Final step is defining the default values for the colors in RGB format, this can be done in a global CSS file in your Nuxt application. See the styling section at Nuxt documentation for more information.
Visit the nuxt-unstyled-tailwind project as an example.