Closed gorlanova closed 10 months ago
Update : I'm using :where()
in my library (so it's easy for users to override base styles)
I've tried (in the browser CSS tab)
:where()
to selectors from the base styles:where()
from my component selectorsEither way seems to fix the issue so it looks like it's a question of priority... Has anything changed with the order the stylesheets are loaded / the selectors used in the base theme ? It was working just fine until I did npm i
again
I can't remove :where()
from my library because it improves user DX so much
Can you share your repo where this is happening? Usage of :where
in your library code shouldn't affect that.
Hello @brc-dd thank you for your feedback, unfortunately the repo is private (it's company work) but would it be doable if I invite you to have access to it so you can have a look behind the scenes ? I'm not up to date on github etiquette so I don't know if that's something to do, I'm checking with my boss in the mean time to know if he's ok with that
would it be doable if I invite you to have access to it so you can have a look behind the scenes
Yeah it'd fine. You can contact me on Discord (available as @brc_dd
).
BTW I don't need access to the whole repo. If you can create a trimmed down version (https://stackoverflow.com/help/minimal-reproducible-example) where it shows your problem, then it would be easier as it need not contain your internal code. You can use https://vitepress.new and add only one small component and check if vitepress styles are breaking your component styles.
Hi again, thank you for being so reactive !
I managed to create a trimmed down version for you so see the issue, you're right it will be better than giving access to a lot of code since with only a few files we can see what goes wrong.
The repo is here : https://github.com/gorlanova/bug-vitepress
To see the issue : launch the doc, go to the page "/reference/button", at the bottom of the page is the preview section, and we can see that the button is not styled properly.
Thank you again for your help with this issue !
Hi, please change includeFiles
to includeFiles: [/vp-doc\.css/, /base\.css/]
Oh my, that's it, everything works perfectly ! Thank you so much for your help, I would've never figured this out myself
And happy new year !
Describe the bug
I'm writing documentation for a component library.
I was using "vp-raw" on my demo containers and it was working perfectly, but recently I made a clean dependency install (deleted node modules and package-lock.json, then ran
npm i
)And now the "vp-raw" seems to not be working anymore, the default vp styles apply in my demo code (I didn't change anything else in the config or whatever, the postcss config file is still there and hasn't been touched)
Is it a conflict with another dependency maybe ? Appreciate any lead / tip you could give me
Thanks for the amazing work !
Reproduction
Use the "vp-raw" class on a container in a vitepress file, and try to apply a background on a button inside of it, it won't work
Expected behavior
It should disable vp styles so my library styles are applied without being overriden
System Info
Additional context
No response
Validations