Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind v3 support #6

Closed
bigardone opened this issue Jan 10, 2022 · 14 comments
Closed

Tailwind v3 support #6

bigardone opened this issue Jan 10, 2022 · 14 comments

Comments

@bigardone
Copy link

Hi there!
Here is a big fan of this library :)
Tailwind v3 came out some weeks ago. Are you planning to upgrade this library to support it?
Cheers!

@matheus23
Copy link
Owner

Hi @bigardone :)

There's some discussion about that in the elm-tailwind-modules repository: matheus23/elm-tailwind-modules#9

Unfortunately, it's likely not super easy to pull off :/

@shaydon
Copy link

shaydon commented Aug 29, 2022

Is it possible to update this package now that elm-tailwind-modules is successfully updated?

@matheus23
Copy link
Owner

I haven't tried yet. It may or may not be. I think tailwind v3 just added a lot of new classes now that they've enabled the JIT by default in v3. When trying to publish this to the elm packages site, we may hit package size restrictions.

@matheus23
Copy link
Owner

matheus23 commented Aug 29, 2022

Yeah, with tailwind v3 the Tailwind.Utilities module is at an amazing 1.2 million lines of code. I doubt I'll be able to (or should) upload that to the elm package repository :/

Sorry, tailwind v3 will probably not land unless someone figures out a "sensible subset" of a tailwind v3 config that can be published. Anyone with a plan, please feel free to comment/open a new issue :)

@shaydon
Copy link

shaydon commented Aug 30, 2022

I see, thank you for looking. If I understand correctly the package repository doesn't have a problem with lines of code as such - I believe elm install always pulls the code directly from GitHub? - but it does place a hard limit of 768000 bytes on the size of the generated docs. Even with completely empty doc comments the v3 docs.json is close to 8mb - so yeah, a v3 version of this package isn't going to be publishable in its current form.

@matheus23
Copy link
Owner

Great research, thanks for that.

@synalysis
Copy link

I see, thank you for looking. If I understand correctly the package repository doesn't have a problem with lines of code as such - I believe elm install always pulls the code directly from GitHub? - but it does place a hard limit of 768000 bytes on the size of the generated docs. Even with completely empty doc comments the v3 docs.json is close to 8mb - so yeah, a v3 version of this package isn't going to be publishable in its current form.

I've added an issue regarding the size limit: elm/package.elm-lang.org#361.

I'd also love to see Tailwind 3 support.

@matheus23
Copy link
Owner

An update on this: @dillonkearns and I have actually started some work on abstracting out the color values from tailwind styles. I.e. you'd write Tw.border Tw.green_500 instead of Tw.border_green_500.
This results in much smaller bundles. There's some details to iron out (and we need to find time to work on this 👀), but it's a very promising approach so far.
matheus23/elm-tailwind-modules#13

@dillonkearns
Copy link

See also matheus23/elm-tailwind-modules#12.

@nathanbraun
Copy link

@matheus23 and @dillonkearns how is this going? would be happy to try and help out anyway i can!

@dillonkearns
Copy link

There's not much you can do without having a lot of context on the ongoing work, but feel free to follow along with the remaining todos and commits we're pushing #13. We're making good progress!

@matheus23
Copy link
Owner

The most recent PR is now matheus23/elm-tailwind-modules#16 (due to some logistics).

We've got a todo-list for remaining work: https://github.com/matheus23/elm-tailwind-modules/blob/67ad0973cb6787b99a12d12302604f21cbe7d1c9/Plan.md
(see the "Auto-abstract colors" sub-todos)

It's pretty much generating the opacity_50, opacity_55, etc. definitions for the Theme file as well as cleaning up some thing regarding the documentation generator and how exactly we want the Theme file to look like/be structured, what should be exposes, what shouldn't or in what ways and finally the release.

Sorry the bottleneck there is pretty much me!

@nathanbraun
Copy link

nathanbraun commented Jan 23, 2023

Awesome, no worries. I get how it goes. If it helps, I think elm-tailwind-modules is very much underrated and I very much appreciate both your guys hard work. Elm is great, tailwind is great, and the ability to get tailwind classes type checking in the compiler with this package (and the ability to autogenerate it with https://html-to-elm.com) makes it all even better. Looking forward to using the stuff whenever it's out. Cheers!

@matheus23
Copy link
Owner

matheus23/elm-tailwind-modules#16 is now merged and released as elm-tailwind-modules version 0.5.0-alpha1.

It now supports "abstracted out colors" in tailwind utilities: https://package.elm-lang.org/packages/matheus23/elm-default-tailwind-modules/latest/Tailwind-Utilities#bg_color

This allows elm-default-tailwind-modules to barely fit within the 768kB upload limit for the package documentation.

And yeah, needless to say I've uploaded elm-default-tailwind-modules version 3.0.0. It's built with tailwind version 3.1.8 for now.

Let me know how this goes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants