-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
vitepress will cause component styles to be lost #4447
Comments
Have you added the postcss plugin to handle |
Already added |
Open: https://playground.view-shadcn-ui.devlive.org/ <template>
<ShadcnAlert>
<p>Welcome to the View Shadcn UI Playground</p>
<p>欢迎来到 View Shadcn UI 演练场</p>
</ShadcnAlert>
<br />
<ShadcnInput placeholder="Input" v-model="input" disabled />
</template>
<script setup lang="ts">
</script> The effect can be rendered, but the component effect is lost when used in the vitepress document |
It's because of the reset styles in vitepress. It's adding background-color: transparent to input. |
Re-installing vitepress in your repo seems to work fine. Can you try adding |
After reinstalling, the same problem |
update import { postcssIsolateStyles } from 'vitepress'
export default {
plugins: [
postcssIsolateStyles({
includeFiles: [/vp-doc\.css/, /base\.css/]
})
]
} |
Please see https://playground.view-shadcn-ui.devlive.org/?codeKey=code-editor-search Executing Command + F (on mac) in the editor still affects my position style The correct one is |
Position calculation logic in |
In viewpress https://view-shadcn-ui.devlive.org/components/view/code-editor.html#context-menu playground URL : https://playground.view-shadcn-ui.devlive.org/?codeKey=code-editor-context-menu Use the right mouse button The position calculated in the code is correct, but it is not displayed |
I am confused that the problem only occurs when pageX and pageY are nested in vitepress. There is no such problem when using them separately. I use appendBody. Are there any restrictions on pageX and pageY in vitepress? |
It's not happening on your playground because there is no scrollbar there. clientX/Y and pageX/Y will be same if your page is at it's very top/left. Refer https://stackoverflow.com/a/21452887/11613622 -- it's unrelated to vitepress. |
Thank you so much |
Describe the bug
My calling method is
The expected rendering result is
The result of rendering in vitepress is
Causes disabled styles to be lost
Reproduction
The component reference address that caused the problem
https://view-shadcn-ui.devlive.org/components/form/input.html#disabled
Expected behavior
None
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: