Skip to content
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

postcssIsolateStyles mess up original styles #2868

Closed
4 tasks done
xsjcTony opened this issue Aug 28, 2023 · 2 comments
Closed
4 tasks done

postcssIsolateStyles mess up original styles #2868

xsjcTony opened this issue Aug 28, 2023 · 2 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@xsjcTony
Copy link
Contributor

Describe the bug

Hover state on link in .vp-doc is always matched, seems :hover is being truncated.
Snipaste_2023-08-29_00-58-54

Copy button in code block is also messed up.
Snipaste_2023-08-29_01-02-12
Snipaste_2023-08-29_01-01-27

Table style messed up as well.

I guess there's a lot more...

Reproduction

In config.ts:

export default defineConfig({
  vite: {
    css: {
      postcss: {
        plugins: [
          postcssIsolateStyles({
            includeFiles: [/vp-doc\.css/]
          }),
        ],
      },
    }
})

I would write one if required, but since my above example is pretty easy to reproduce, I'll leave it blank here.

Expected behavior

Style not messed up

(NOTE: it's working properly if I use postcss-prefix-selector straight away instead of using the one from vitepress package)

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz
    Memory: 38.35 GB / 63.84 GB
  Binaries:
    Node: 18.16.0 - C:\NodeJS\node.EXE
    Yarn: 1.22.19 - C:\NodeJS\yarn.CMD
    npm: 9.8.1 - C:\NodeJS\npm.CMD
    pnpm: 8.7.0 - C:\NodeJS\pnpm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (116.0.1938.62)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vitepress: ^1.0.0-rc.9 => 1.0.0-rc.9

Additional context

No response

Validations

@xsjcTony xsjcTony added the bug: pending triage Maybe a bug, waiting for confirmation label Aug 28, 2023
@brc-dd
Copy link
Member

brc-dd commented Aug 28, 2023

Hey, can you paste your postcss-prefix-selector config? It should've worked fine 👀 We are just bundling it.

@xsjcTony
Copy link
Contributor Author

Hey, can you paste your postcss-prefix-selector config? It should've worked fine 👀 We are just bundling it.

Sorry I'm afk now, but my plugin config is copied from the previous version of vitepress doc (for that section), so you can refer to there.

@brc-dd brc-dd closed this as completed in 21b4f8c Aug 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants