When using tailwind v3.4.3 on tailwind playground space is added b/w span elements
<div>
<p>
<span class="bg-slate-800">TEST</span>
<span class="bg-orange-600">TEST 2</span>
<span class="bg-yellow-500">TEST 3</span>
</p>
</div>
Copy Paste the above code on play.tailwindcss.com You can see the extra space added b/w span elements.
When I try to do similar thing in Nuxt 3 with tailwind installation, space between span elements is missing.
I have already setup edit with nuxt and tailwind configuration, editor link
I have also installed tailwind using nuxt modules '@nuxtjs/tailwindcss', but still the issue persists.
I am currently migrating my project from nuxt 2 to nuxt 3, nuxt 2 project show similar behaviour as shown by tailwindcss playground, but on nuxt 3 its breaking.
Solving this space issue would be a great help to the project.
By default, Vue compiles SFCs with whitespace condensed. To change this behavior, edit nuxt.config.ts
export default defineNuxtConfig({
vue: {
compilerOptions: {
whitespace: 'preserve'
}
}
})
FYI, when not using Nuxt, the required config change is slightly different in vite.config.ts
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
whitespace: 'preserve'
}
}
})
]
})