NuxtN
Nuxtβ€’2y ago
> Rodrigo

Per page Tailwind opt-in or opt-out! [nuxt/ui]

Hello good people of the internet! I have challenge I would like to solve and maybe improve some modules out there with it! πŸ™‚

I have at my hands a very big CMS Renderer (the frontend part) built with Nuxt 3 and I would like to give some context:
  • It renderes a lot of websites depending on a special header that we will call
    site-key
    this header could have values like
    facebook
    ,
    amazon
    , etc and makes a request to the CMS and builds the page for that key.
  • It uses normal CSS styles and some SASS sometimes.
The problem πŸ₯

We want to incorporate a new fantastic website that sells precious candles but they are edgy and really like the future o Tailwind V4 (who could blame them right?) and want to bring Tailwind to the mixture and use Nuxt UI Pro! Currently when you use
nuxt/ui
in your project it installs all the plugins and modules it needs and leaks the tailwind base CSS file to every page Nuxt serves which
Amazon
is not really a fan... It includes some resets in some styles and a base CSS file that is imported everywhere and 3 Nuxt plugins that could be skipped when some clientes don't want to use Nuxt UI for example!

Basically a way to, at runtime, disable tailwind CSS import and the easy part stop the execution of Nuxt UI plugins!

I am free to hear any ideas and to implement them bringing more flexibility to the ecosystem! :nuxt:
Was this page helpful?