Skip to content

Styling discrepancies between dev and build #4098

Closed
@dasdawidt

Description

Describe the bug

Just like the Vite docs, I use custom styles in the index.md file using <style module>. I also use custom components in which I use <style scoped>.

Since 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.

Reproduction

Open the StackBlitz Demo with this link.

If it does not run automatically, run npm install && npm run dev. It should look something like this:

image

Then run npm run docs:build && npm run docs:preview and it will look like this:

image

As you can see, the hero image and its background are different and the cards are different as well.

Expected behavior

I expected the built version to look just like the dev preview (or at least very close).

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 AMD Ryzen 5 5500U with Radeon Graphics
    Memory: 6.45 GB / 15.35 GB
  Binaries:
    Node: 21.2.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.1.2 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    vitepress: ^1.3.1 => 1.3.1

Additional context

No response

Validations

Metadata

Assignees

No one assigned

    Labels

    buildRelated to the build systemhelp wantedExtra attention is neededstaleupstreamRelated to the dependencies

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions