Skip to content

Question about "PostCSS Has Pseudo" for building #1504

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

Closed
Annie972297 opened this issue Nov 7, 2024 · 3 comments
Closed

Question about "PostCSS Has Pseudo" for building #1504

Annie972297 opened this issue Nov 7, 2024 · 3 comments

Comments

@Annie972297
Copy link

Hi, I'm using "PostCSS Has Pseudo" in a Vue+Vite project to use :has() in lower versions of Firefox, such as 110.0.
I followed the opetaions in README.md:

  1. npm install css-has-pseudo --save-dev
  2. Use it as a PostCSS plugin: import it and use it in the file "postcss.config.js"
  3. initialize cssHasPseudo: use it in the file "App.vue"
    import cssHasPseudo from 'css-has-pseudo/browser'; cssHasPseudo(document);

It works when I run the project locally with a mock server, but it doesn't work when I build the project and run it with a real server. In the build product, there're ".js-has-pseudo [csstools-has-xxx" in the stylesheet, but there's no "[csstools-has-xxx" attribute added to the elements.
I think the operation "cssHasPseudo(document)" is the most important, but how can it works when building the project?

@romainmenke
Copy link
Member

Hi @Annie972297,

I am unsure what could be the cause of this.

Do you have a project you can share that has this issue?
Something I can run and inspect.

@romainmenke
Copy link
Member

@Annie972297,

Have you checked if there are errors in the browser console about CORS?

See: https://github.com/csstools/postcss-plugins/tree/main/plugins/css-has-pseudo#cors

@romainmenke
Copy link
Member

Closing this issue because of a lack of reply.

@Annie972297 happy to help if you provide more info :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants