heybourn / headwind

An opinionated Tailwind CSS class sorter built for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=heybourn.headwind
MIT License
1.37k stars 46 forks source link

Support for PHP files #162

Open MarkusHeinisch opened 2 years ago

MarkusHeinisch commented 2 years ago

Currently the plugin supports only html files, right? Can you support php-files (used for wordpress theme template development) too?

Thanks

schtibe commented 2 years ago

You're probably able to solve this by adding a classRegex option to the settings. I did this for .njk files and just inserted the same regex as is used for html files:

  "headwind.classRegex": {
    "njk": "\\bclass\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\']"
  }