RadValentin / postcss-prefix-selector

Prefix all CSS rules with a selector
MIT License
165 stars 16 forks source link

How can I implement this with Parcel Bundler? #88

Closed pepas24 closed 3 years ago

pepas24 commented 3 years ago

Hi, first at all thanks for the project This is just what I need, but I don't know how to configure it properly, can you point me out how to setup the plugin using Parcel Bundler?

RadValentin commented 3 years ago

Hey @pepas24,

I set up a simple project using Parcel and as far as I can tell this plugin should work just like any other postcss plugin, see the docs here.

What I did:

  1. Followed the Parcel getting started guide
  2. Added these two dependencies:
    "devDependencies": {
    "postcss": "^8.2.15",
    "postcss-prefix-selector": "^1.9.0"
    }
  3. Added a .postcssrc.js file in my project, example:
    module.exports = {
    "plugins": {
        "postcss-prefix-selector": {
            "prefix": ".my-prefix",
            "exclude": ["body"]
        }
    }
    }

After that, all CSS files that were used in my project go prefixed. Let me know if this helped or if there's something else that's not working for you.

pepas24 commented 3 years ago

Thanks, it works like a charm