nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.1k stars 623 forks source link

w-full is not respected in Vue Markdown Block Component #2802

Open FantixX opened 1 week ago

FantixX commented 1 week ago

Environment


Reproduction

Layout:

<template>
    <div class="max-w-6xl brd m-auto flex flex-col items-center brd min-h-dvh prose-lg">
        <NavBar></NavBar>
        <slot></slot>
    </div>
</template>

Component:

<template>
    <div class="brd w-full">
        <div>Component Content</div>
        <slot></slot>
    </div>
</template>

Markdown:

::component-name
Content
::

Expected result image

Actual result: image

Describe the bug

Due to the wrapper div which is created by the framework, CSS/Tailwind classes like w-full do not work as expected in a component in markdown. This seems like a big issue, as it makes styling for components used in markdown very unpredictable. Maybe I overlook something, but why should components work differently in markdown compared to when I use them directly in other .vue components?

Additional context

No response

Logs

No response

larbish commented 1 week ago

ContentRenderer rendered a <div> around the markdown so I f you want to apply the w-full to this div also you can just do this: <ContentRenderer class="w-full" … />