dillonkearns / elm-review-html-to-elm

Turn HTML into Elm. With support for elm-tailwind-modules.
http://html-to-elm.com/
BSD 3-Clause "New" or "Revised" License
95 stars 9 forks source link

Add configuration option for custom pattern for Tailwind color palette #24

Open dillonkearns opened 1 year ago

dillonkearns commented 1 year ago

There is currently a hardcoded Regex that matches the default Tailwind v3 color theme names:

https://github.com/dillonkearns/elm-review-html-to-elm/blob/e2ed0f06e5e571ae8bd7bff42cde6e89da3c2b34/src/TailwindClass.elm#L124

However, this will not catch colors from a custom Tailwind configuration if they don't follow the same pattern. One solution to support this would be to add an option in the configuration where the user can pass in a custom Regex string that will be used instead of the default when provided.

dillonkearns commented 1 year ago

See also discussion in #21