DEV Community

Cover image for How to share tailwind configuration between nuxt layers
Ismael Garcia
Ismael Garcia

Posted on

10 1 1 1 1

How to share tailwind configuration between nuxt layers

While working in the nuxt-layer-monorepo I encounter a issue with the tailwind styles:

  • UI Layer have a tailwind config file and override the default tailwind CSS configurations
  • Then using the UI Layer in the Content layer

Tailwind configurations got reset to the base for some reason, even that the layers' config should be use

So the solution that I found and is currently working is just to create a new tailwind.config.ts in the Content layer

and put the following on it:

import twc from "@local-monorepo/ui/tailwind.config"


export default twc
Enter fullscreen mode Exit fullscreen mode

Basically importing the tailwind config from the UI Layer and using that in the Content layer.

Note

This is working for me, but please if there is a better way kindly let me know.

**Happy hacking!

view raw socials.md hosted with โค by GitHub

Working on the audio version

The Loop VueJs Podcast

๐Ÿ‘‹ One last chance before you go!

It takes one minute to join DEV and is worth it for your career.

You get 3x the value by signing in instead of lurking

Get started

Top comments (1)

Sentry image

See why 4M developers consider Sentry, โ€œnot bad.โ€

Fixing code doesnโ€™t have to be the worst part of your day. Learn how Sentry can help.

Learn more

๐Ÿ‘‹ Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay