Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

laracoft's avatar
Level 27

Styling Vue from Blade with Tailwind

  1. I have been playing around with Vue and styling it with Tailwind
  2. What I do is build the highly interactive block using Vue and mount it in my Laravel blade
  3. Sometimes, these highly interactive blocks require different styling for different projects
  4. Is there a way to compile the Vue only once, but allow it to be styled from Laravel?
0 likes
2 replies
RemiM's avatar

I’m not sure I understand your question. Typically, during development, you run npm run dev

This starts the development server and keeps running to provide hot module replacement (HMR) and real-time updates as you make changes.

When you're ready to deploy your application to production, you run npm run build

This generates optimized production assets. Unlike npm run dev, which runs continuously, npm run build is a one-time command that outputs the final files for production use.

laracoft's avatar
Level 27

@RemiM

  1. Let's say my Vue component is a chat icon that floats on the page
  2. Clicking on it opens a window that allows me to chat
  3. This can be reused in project A, B, C, D
  4. But it has only 1 look and feel, how do I give CSS control of the chat icon to each of the projects without each project having to run npm run build or dev
  5. Imagine a scenario where I don't want to give them my Vue source code

Please or to participate in this conversation.