Skip to content

Question about "PostCSS Has Pseudo" for building #1504

Closed
@Annie972297

Description

@Annie972297

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions