elm-review-html-to-elm
elm-review-html-to-elm copied to clipboard
Turn HTML into Elm. With support for elm-tailwind-modules.
```html hello ``` produces ```elm span [ css [ Bp.group-hover [ Tw.text_gray_900 ] ] ] [ text "hello" ] ``` where `group-hover` isn't valid elm function name ref https://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-parent-state
Amazing and helpful tool! I ran into a small issue when copying HTML from TailwindUI into elm-to-html.com The issue is that `text` nodes are run through [`String.trim`](https://github.com/dillonkearns/elm-review-html-to-elm/blob/39cdfd5512e01da623059396b6e4903bbcc24e0f/src/HtmlToTailwind.elm#L48-L63). This makes for...
Out of curiosity after #14, I checked to see whether there are any other formatting blemishes and ran a diff of the ete-test output. It's pretty close now, but I...
When converting a TailwindUI module I noticed three problems. The HTML ` ` produces ``` button [ Attr.type_ "button" , css [ Tw. , Tw. , Bp.[.dark[data-theme=system]_&] [ Tw.block ]...
I noticed on the https://html-to-elm.com/ website, `"` inside strings are not escaped in the generated Elm code. For example `"Test"` will generate `Html.text ""Test""`
The following `test ` html becomes `Html.text "test"`. Notice that the trailing space is removed. This can cause problems if there's more text following after the div that then gets...
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...
As described in #19.
The new `elm-tailwind-modules` uses opacities from a set of values in the generated module `Tailwind.Theme`, similar to the Color values which are now supported with #21 (example Theme module: https://package.elm-lang.org/packages/matheus23/elm-default-tailwind-modules/latest/Tailwind-Theme#opacity50)....