-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Default theme: Add class to opt out of .vp-doc styles #4731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@brc-dd I'm struggling to get the Embedding in I also tried including this: import { postcssIsolateStyles } from "vitepress";
export default {
plugins: [postcssIsolateStyles({
includeFiles: [/vp-doc\.css/]
})]
}; And this: import { postcssIsolateStyles } from "vitepress";
export default {
plugins: [postcssIsolateStyles()]
}; But the output .vp-doc p, .vp-doc summary {
margin: 16px 0;
} No prefixes anywhere. 🤷♂ What is the expected outcome in terms of CSS output? |
Set Your first code should've worked fine. The issue might be that the file isn't being picked up. Try restarting the dev server and ensure it's in your vitepress root. You can add some https://stackblitz.com/edit/vite-e43c9woi?file=docs/postcss.config.mjs,docs/index.md |
I see now how this should work. I think this might be broken by the fact that I use the I'll do some more digging - if you have any immediate thoughts on how to get PostCSS to play nice with Tailwind 4, feel free to share. |
https://stackblitz.com/edit/vite-3bpkfct8?file=docs/index.md seems to work fine with tailwind v4 too. |
Ah yes 👍🏻 The deciding difference in my case seems to be that I'm importing the theme stylesheets from CSS with I'll try to rethink... thanks, your repro helped me zero in on the difference! |
Is your feature request related to a problem? Please describe.
When adding Vue components or HTML markup inside a
doc
orpage
markdown file, it's frustrating to have to contend with the global.vp-doc
styles.Describe the solution you'd like
It would be very nice to have a
.not-vp-doc
class to negate and opt out of the global.vp-doc
styles (for the element where you apply.not-vp-doc
and all descendants) similar to the.prose
and.not-prose
classes used by @tailwindcss/typography.Describe alternatives you've considered
I started creating my own override
vp-doc.css
stylesheet, but maintaining it and also getting it imported instead of the default one requires too much duplication files of the default theme.I also considered mechanisms to opt out of the
.vp-doc
styles at the theme level inLayout.vue
but it really doesn't solve the problem - the opt-out needs to be able to happen on a specific fragment or component when embedded inside an.md
file that otherwise consists primarily of markdown content.Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: