Environment
Nuxt project info:
|
|
| Operating system |
Linux 6.17.0-20-generic |
| CPU |
13th Gen Intel(R) Core(TM) i7-1355U (12 cores) |
| Node.js version |
v25.6.0 |
| nuxt/cli version |
3.34.0 |
| Package manager |
npm@11.8.0 |
| Nuxt version |
4.4.2 |
| Nitro version |
2.13.3 |
| Builder |
vite@7.3.2 |
| Config |
compatibilityDate, css, devtools, modules |
| Modules |
@nuxt/ui@4.6.1, @nuxt/content@3.13.0, @nuxt/image@2.0.0 |
Is this bug related to Nuxt or Vue?
Nuxt
Package
v4.x
Version
4.6.1
Reproduction
https://github.com/nimonian/nuxt-ui-img-repro
Description
{width=200} should always render an image 200px wide
however, Nuxt UI's ProseImg component always applies w-full in its base slot theme, which clobbers widths chosen from markdown
// .nuxt/ui/prose/img.ts
slots: {
base: "rounded-md w-full"
}
consequently, images always stretch to 100% of parent width
note that this bug will only occur when we have
/* app/assets/css/main.css */
@import "tailwindcss";
@import "@nuxt/ui";
without this, tailwind appears not to compile the w-full utility which masks the issue
i believe the example in the Nuxt UI docs only appears to function correctly because it is wrapped in a flex container
the whole pipeline works correctly - width="200" does appear on the element - but the width: 100% coming from tailwind will always win
i intend to submit a PR for this
Additional context
Logs
Environment
Nuxt project info:
Linux 6.17.0-20-generic13th Gen Intel(R) Core(TM) i7-1355U (12 cores)v25.6.03.34.0npm@11.8.04.4.22.13.3vite@7.3.2compatibilityDate,css,devtools,modules@nuxt/ui@4.6.1,@nuxt/content@3.13.0,@nuxt/image@2.0.0Is this bug related to Nuxt or Vue?
Nuxt
Package
v4.x
Version
4.6.1
Reproduction
https://github.com/nimonian/nuxt-ui-img-repro
Description
{width=200}should always render an image 200px widehowever, Nuxt UI's ProseImg component always applies
w-fullin its base slot theme, which clobbers widths chosen from markdownconsequently, images always stretch to 100% of parent width
note that this bug will only occur when we have
without this, tailwind appears not to compile the
w-fullutility which masks the issuei believe the example in the Nuxt UI docs only appears to function correctly because it is wrapped in a flex container
the whole pipeline works correctly -
width="200"does appear on the element - but thewidth: 100%coming from tailwind will always wini intend to submit a PR for this
Additional context
Logs