\n\n### Reproduction\n\nnone\n\n### Expected behavior\n\nThe text inside the Badge component should not wrap and should remain on the same line to avoid disrupting the table layout.\n\n### System Info\n\n```Text\nnone\n```\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [x] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [x] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [x] Read the [docs](https://vitepress.dev).\n- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2867],{"name":2868,"color":2869},"bug: pending triage","e99695",4764,"vuejs","vitepress","open","Badge component unexpectedly breaks line in tables with long text","2025-05-27T08:28:39Z","https://github.com/vuejs/vitepress/issues/4764",0.72106385,{"description":2879,"labels":2880,"number":2884,"owner":2871,"repository":2872,"state":2873,"title":2885,"updated_at":2886,"url":2887,"score":2888},"### Is your feature request related to a problem? Please describe.\r\n\r\nsuch as a vue components library site……\r\nA common problem for a documentation page is to show how to use a component, both in code and with demo of live component.\r\n\r\n### Describe the solution you'd like\r\n\r\nlike this [https://github.com/flingyp/vitepress-demo-preview](https://github.com/flingyp/vitepress-demo-preview)\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2881],{"name":2882,"color":2883},"stale","ededed",3270,"Feature request: Vue component source code demo","2024-01-18T18:48:08Z","https://github.com/vuejs/vitepress/issues/3270",0.72673917,{"description":2890,"labels":2891,"number":2892,"owner":2871,"repository":2872,"state":2893,"title":2894,"updated_at":2895,"url":2896,"score":2897},"### Describe the bug\n\n\r\n\r\nMy component style is the red box on the left, and the blue box on the right is the default of vitepress, which causes the style of my component to be overwritten. How can I configure the table style without using vitepress and use the style of my component?\r\n\r\n我的组件样式是左侧红框的,右侧蓝框是 vitepress 默认的,导致覆盖了我组件的样式,我怎么才能配置不使用 vitepress 的 table 样式,用我组件的样式\n\n### Reproduction\n\nNone\n\n### Expected behavior\n\nNone\n\n### System Info\n\n```Text\nNone\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[],4309,"closed","How to disable all styles for a .vp-doc table","2024-11-04T04:43:46Z","https://github.com/vuejs/vitepress/issues/4309",0.58110434,{"description":2899,"labels":2900,"number":2901,"owner":2871,"repository":2872,"state":2893,"title":2902,"updated_at":2903,"url":2904,"score":2905},"### Is your feature request related to a problem? Please describe.\n\nWhen adding Vue components or HTML markup inside a `doc` or `page` markdown file, it's frustrating to have to contend with the global `.vp-doc` styles.\n\n### Describe the solution you'd like\n\nIt 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](https://github.com/tailwindlabs/tailwindcss-typography).\n\n### Describe alternatives you've considered\n\nI 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.\n\nI also considered mechanisms to opt out of the `.vp-doc` styles at the theme level in `Layout.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.\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [x] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [x] Read the [docs](https://vitepress.dev).\n- [x] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [x] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],4731,"Default theme: Add class to opt out of .vp-doc styles","2025-05-04T08:39:09Z","https://github.com/vuejs/vitepress/issues/4731",0.65257424,{"description":2907,"labels":2908,"number":2912,"owner":2871,"repository":2872,"state":2893,"title":2913,"updated_at":2914,"url":2915,"score":2916},"### Describe the bug\n\nWhen I customize a link component and introduce it into vitepress, the `vp-doc` class generates a style override on my custom style, causing my style to not display properly:\r\n\r\nI've tried `vp-raw` for style isolation, but it still doesn't display my custom styles properly\r\n\r\nI don't know how to solve this style override problem, which has been bothering me for a long time\n\n### Reproduction\n\nThis is my custom link component:\r\n```tsx\r\nimport { defineComponent, PropType, ref } from \"vue\";\r\nimport \"uno.css\";\r\n\r\nexport type IType = 'default' | 'primary' | 'success' | 'warning' | 'danger'| 'info'\r\nexport type IColor = 'black' | 'blue' | 'green' | 'yellow'| 'red' | 'gray'\r\nexport const props = {\r\n type: {\r\n type: String as PropType\u003CIType>,\r\n default: \"default\",\r\n },\r\n color: {\r\n type: String as PropType\u003CIColor>,\r\n default: \"black\",\r\n },\r\n plain: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n href: {\r\n type: String,\r\n required: true,\r\n },\r\n} as const;\r\n\r\nexport default defineComponent({\r\n name: \"CLink\",\r\n props,\r\n setup(props, { slots }) {\r\n return () => (\r\n \u003Ca\r\n class={`\r\n text-${props.plain ? props.color + \"-500\" : \"white\"}\r\n hover:text-${props.color}-400\r\n cursor-pointer\r\n text-lg\r\n hover:text-white\r\n transition duration-300 ease-in-out transform hover:scale-105\r\n mx-1\r\n decoration-none\r\n `}\r\n href={props.href} \r\n >\r\n {slots.default ? slots.default() : 'Link'}\r\n \u003C/a>\r\n ); \r\n },\r\n});\r\n```\r\n\r\nHere's my demo code from the documentation:\r\n```vue\r\n\u003Cdiv class=\"vp-raw\">\r\n \u003CCLink href=\"#\" class=\"primary\" color=\"blue\">Primary Link\u003C/CLink>\r\n \u003CCLink href=\"#\" type=\"success\" color=\"green\">Success Link\u003C/CLink>\r\n \u003CCLink href=\"#\" type=\"warning\" color=\"yellow\">Warning Link\u003C/CLink>\r\n \u003CCLink href=\"#\" type=\"danger\" color=\"red\">Danger Link\u003C/CLink>\r\n \u003CCLink href=\"#\" type=\"info\" color=\"gray\">Info Link\u003C/CLink>\r\n\u003C/div>\r\n```\r\n\r\n\r\n\n\n### Expected behavior\n\nI want to be able to display the style of my components properly, in fact I can be sure that the `vp-doc` generated style override, I delete this class by manipulating the DOM and then the style can be displayed normally, but this will make the other functions of vitepress failure, I want to be able to display the style of the component without affecting vitepress\n\n### System Info\n\n```shell\n{\r\n \"name\": \"catisol-ui\",\r\n \"version\": \"0.9.1\",\r\n \"description\": \"\",\r\n \"main\": \"index.js\",\r\n \"scripts\": {\r\n \"test\": \"vitest\",\r\n \"build\": \"vite build\",\r\n \"dev\": \"vite\",\r\n \"docs:dev\": \"vitepress dev docs\",\r\n \"docs:build\": \"vitepress build docs\",\r\n \"docs:serve\": \"vitepress serve docs\"\r\n },\r\n \"keywords\": [],\r\n \"author\": \"\",\r\n \"license\": \"ISC\",\r\n \"devDependencies\": {\r\n \"@iconify-json/ic\": \"1.1.4\",\r\n \"@vitejs/plugin-vue\": \"3.0.3\",\r\n \"@vitejs/plugin-vue-jsx\": \"2.0.0\",\r\n \"@vue/test-utils\": \"2.0.2\",\r\n \"happy-dom\": \"6.0.4\",\r\n \"postcss\": \"^8.4.21\",\r\n \"postcss-prefix-selector\": \"^1.16.0\",\r\n \"unocss\": \"0.45.6\",\r\n \"vite\": \"3.0.7\",\r\n \"vitepress\": \"v1.0.0-alpha.31\",\r\n \"vitest\": \"0.21.1\"\r\n },\r\n \"maintainers\": [\r\n \"isolcat\"\r\n ],\r\n \"dependencies\": {\r\n \"@unocss/vite\": \"^0.45.13\",\r\n \"vue\": \"3.2.37\"\r\n }\r\n}\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2909],{"name":2910,"color":2911},"need more info","bdbefc",1777,"vp-raw cannot isolate style conflicts generated by v-doc classes","2023-01-21T14:16:44Z","https://github.com/vuejs/vitepress/issues/1777",0.66035086,{"description":2918,"labels":2919,"number":2920,"owner":2871,"repository":2872,"state":2893,"title":2921,"updated_at":2922,"url":2923,"score":2924},"### Is your feature request related to a problem? Please describe.\r\n\r\nI use Vitepress to document my component library. Sometimes, the style of the components is \"overridden\" by the Vitepress CSS, or just applied.\r\n\r\nFor example, with a component using a `\u003Ctable />` HTMLElement (https://maz-ui.com/components/maz-table), the VitePress CSS is applied to my component and changes its style. **I don't want it.** \r\n\r\n[See CSS file here](https://github.com/vuejs/vitepress/blob/df8753bd927c2b57b9188fb292c1429e9c3c8ab6/src/client/theme-default/styles/components/vp-doc.css#L176)\r\n\r\n```css\r\n.vp-doc table {\r\n display: block;\r\n border-collapse: collapse;\r\n margin: 20px 0;\r\n overflow-x: auto;\r\n}\r\n\r\n.vp-doc tr {\r\n background-color: var(--vp-c-bg);\r\n border-top: 1px solid var(--vp-c-divider);\r\n transition: background-color 0.5s;\r\n}\r\n\r\n.vp-doc tr:nth-child(2n) {\r\n background-color: var(--vp-c-bg-soft);\r\n}\r\n\r\n.vp-doc th,\r\n.vp-doc td {\r\n border: 1px solid var(--vp-c-divider);\r\n padding: 8px 16px;\r\n}\r\n\r\n.vp-doc th {\r\n text-align: left;\r\n font-size: 14px;\r\n font-weight: 600;\r\n color: var(--vp-c-text-2);\r\n background-color: var(--vp-c-bg-soft);\r\n}\r\n\r\n.vp-doc td {\r\n font-size: 14px;\r\n}\r\n```\r\n\r\n### Describe the solution you'd like\r\n\r\nI don't want the style to be applied to selected elements.\r\n\r\n### Describe alternatives you've considered\r\n\r\nAs the [tailwindcss-typography](https://github.com/tailwindlabs/tailwindcss-typography) library suggests [here](https://github.com/tailwindlabs/tailwindcss-typography?tab=readme-ov-file#advanced-topics) with the class `not-prose`. \r\n\r\nI propose to add a class like `no-vp-style` or something else to not apply CSS to the HTML element where the class is set and other DOM inside.\r\n\r\n```md\r\n## Documentation\r\n\r\n\u003CMazTable class=\"no-vp-style\" />\r\n```\r\n\r\nWith a CSS rule like : \r\n\r\n```css\r\n.vp-doc table:not(:where([class~='no-vp-style'], [class~='no-vp-style'] *)) {\r\n ...\r\n}\r\n```\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],3652,"Add CSS class to disable vitepress CSS to avoid conflicts and override","2024-03-21T00:04:41Z","https://github.com/vuejs/vitepress/issues/3652",0.6671131,{"description":2926,"labels":2927,"number":2931,"owner":2871,"repository":2872,"state":2893,"title":2932,"updated_at":2933,"url":2934,"score":2935},"### Is your feature request related to a problem? Please describe.\n\nI am rendering components in `.vp-doc` and my component's h2 gets style of VitePress which I don't want.\n\n### Describe the solution you'd like\n\nAdd class `not-vp-doc` to omit applying styles\n\n### Describe alternatives you've considered\n\nnone\n\n### Additional context\n\nI checked the source and found that all styles are written in CSS and it isn't quick to apply the `:not()` selector because there's list of `vp-doc` class usage and I might break something in hurry.\r\n\r\nI am in hurry hence creating this issue instead of PR.\r\n\r\nWill the team going to use SCSS in favor or refactor?\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2928],{"name":2929,"color":2930},"duplicate","cfd3d7",808,"Allow excluding styles for tags like h2 in `vp-doc`","2023-01-21T14:34:01Z","https://github.com/vuejs/vitepress/issues/808",0.6715497,{"description":2937,"labels":2938,"number":2940,"owner":2871,"repository":2872,"state":2893,"title":2941,"updated_at":2942,"url":2943,"score":2944},"### Describe the bug\n\nIt occur unexpected css style when I use doc theme,just CSS pollution cause the label selector `.vp-doc table`.\r\n\r\n\n\n### Reproduction\n\n```txt\r\n---\r\nlayout: doc\r\n---\r\n\r\n\u003Cscript setup>\r\n\r\nimport {ElTable} from 'element-plus'\r\n\u003Cscript>\r\n\r\n\u003Cel-table>\u003C/el-table>\r\n\r\n```\r\n`el-table` style is unexpected because `.vp-doc table` `.vp-doc td` `.vp-doc tr` selectors.\n\n### Expected behavior\n\n`el-table` or other html tags have browser's default style in doc theme.\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 10 10.0.22621\r\n CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H\r\n Memory: 1.49 GB / 15.73 GB\r\n Binaries:\r\n Node: 18.15.0 - D:\\Program Files (x86)\\node\\18\\node.EXE\r\n Yarn: 1.22.19 - D:\\Program Files (x86)\\node\\18\\yarn.CMD\r\n npm: 9.5.0 - D:\\Program Files (x86)\\node\\18\\npm.CMD\r\n pnpm: 8.6.8 - D:\\Program Files (x86)\\node\\18\\pnpm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22621.2283.0), Chromium (114.0.1823.67)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: ^1.0.0-rc.13 => 1.0.0-rc.13\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2939],{"name":2868,"color":2869},3077,"unexpected css style","2023-10-25T00:05:22Z","https://github.com/vuejs/vitepress/issues/3077",0.70569605,{"description":2946,"labels":2947,"number":2958,"owner":2871,"repository":2872,"state":2893,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### Describe the bug\n\nJust like the Vite docs, I use custom styles in the `index.md` file using `\u003Cstyle module>`. I also use custom components in which I use `\u003Cstyle scoped>`.\r\n\r\nSince I updated from version `1.0.0` to the latest one (the one in the StackBlitz), the built page's styles are broken. In the dev preview everything looks like expected.\n\n### Reproduction\n\nOpen the StackBlitz Demo with this [link](https://stackblitz.com/edit/vite-1qtmk8?file=docs%2Findex.md).\r\n\r\nIf it does not run automatically, run `npm install && npm run dev`. It should look something like this:\r\n\r\n\r\n\r\nThen run `npm run docs:build && npm run docs:preview` and it will look like this:\r\n\r\n\r\n\r\nAs you can see, the hero image and its background are different and the cards are different as well.\n\n### Expected behavior\n\nI expected the built version to look just like the dev preview (or at least very close).\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 10 10.0.19045\r\n CPU: (12) x64 AMD Ryzen 5 5500U with Radeon Graphics\r\n Memory: 6.45 GB / 15.35 GB\r\n Binaries:\r\n Node: 21.2.0 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 10.5.0 - C:\\Program Files\\nodejs\\npm.CMD\r\n pnpm: 9.1.2 - ~\\AppData\\Roaming\\npm\\pnpm.CMD\r\n Browsers:\r\n Edge: Chromium (127.0.2651.74)\r\n Internet Explorer: 11.0.19041.4355\r\n npmPackages:\r\n vitepress: ^1.3.1 => 1.3.1\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [x] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2948,2951,2954,2957],{"name":2949,"color":2950},"help wanted","008672",{"name":2952,"color":2953},"build","377ba8",{"name":2955,"color":2956},"upstream","BF29ED",{"name":2882,"color":2883},4098,"Styling discrepancies between dev and build","2025-01-05T04:42:47Z","https://github.com/vuejs/vitepress/issues/4098",0.7067665,{"description":2964,"labels":2965,"number":2967,"owner":2871,"repository":2872,"state":2893,"title":2968,"updated_at":2969,"url":2970,"score":2971},"### Describe the bug\n\nHover state on link in `.vp-doc` is always matched, seems `:hover` is being truncated.\r\n\r\n\r\nCopy button in code block is also messed up.\r\n\r\n\r\n\r\nTable style messed up as well.\r\n\r\nI guess there's a lot more...\n\n### Reproduction\n\nIn `config.ts`:\r\n```ts\r\nexport default defineConfig({\r\n vite: {\r\n css: {\r\n postcss: {\r\n plugins: [\r\n postcssIsolateStyles({\r\n includeFiles: [/vp-doc\\.css/]\r\n }),\r\n ],\r\n },\r\n }\r\n})\r\n```\r\n\r\nI would write one if required, but since my above example is pretty easy to reproduce, I'll leave it blank here.\n\n### Expected behavior\n\nStyle not messed up\r\n\r\n (NOTE: it's working properly if I use `postcss-prefix-selector` straight away instead of using the one from vitepress package)\n\n### System Info\n\n```sh\nSystem:\r\n OS: Windows 10 10.0.19045\r\n CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz\r\n Memory: 38.35 GB / 63.84 GB\r\n Binaries:\r\n Node: 18.16.0 - C:\\NodeJS\\node.EXE\r\n Yarn: 1.22.19 - C:\\NodeJS\\yarn.CMD\r\n npm: 9.8.1 - C:\\NodeJS\\npm.CMD\r\n pnpm: 8.7.0 - C:\\NodeJS\\pnpm.CMD\r\n Browsers:\r\n Edge: Spartan (44.19041.1266.0), Chromium (116.0.1938.62)\r\n Internet Explorer: 11.0.19041.1566\r\n npmPackages:\r\n vitepress: ^1.0.0-rc.9 => 1.0.0-rc.9\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2966],{"name":2868,"color":2869},2868,"`postcssIsolateStyles` mess up original styles","2023-09-05T00:04:08Z","https://github.com/vuejs/vitepress/issues/2868",0.7159859,["Reactive",2973],{},["Set"],["ShallowReactive",2976],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f2BaA4Ygn7Y35TqNRrJAVNyGWeAfAUDP1uIZ8vzWXxr4":-1},"/vuejs/vitepress/3523"]