raybrownco / atom-tailwindcss

An Atom autocompletion provider for the utility-first CSS framework Tailwind
https://atom.io/packages/atom-tailwindcss
MIT License
8 stars 3 forks source link

Add Support for tailwind.config.js files #1

Open mneumark opened 4 years ago

mneumark commented 4 years ago

My company, in addition to the default tailwind classes, has defined a number of others in tailwind.config.js. It isn't helpful to have these autocompletions if it doesn't include the custom ones.

raybrownco commented 4 years ago

I completely understand your pain. I feel it myself! However, this is a non-trivial change—if it's even possible—and it would have some performance implications that must be considered. Atom expects a JSON array of completions, and we currently use a build script to generate [completions] for the default Tailwind classes.

In order to provide completions on a per-project basis, we'll have to find a way to check for tailwind.config.js in a project (easy), parse the custom config stuff (easy), and generate modified JSON completions on the fly (potentially hard). I don't have experience with responding to file changes from within a plugin, but I'll look into it. Thanks for the nudge, @mneumark.