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

Amazing idea #5

Open
awb99 opened this issue Feb 25, 2022 · 2 comments
Open

Amazing idea #5

awb99 opened this issue Feb 25, 2022 · 2 comments

Comments

@awb99
Copy link

awb99 commented Feb 25, 2022

I love the idea of this project!

Tailwind css files are always very big
(2mb full set, 4mb full set with dark and light theme)
and the time it takes the browser to process that is
In the second(s) range.

I see two ways of using this library:

  1. Define a list of tags combinations that I want and
    Generate a css file. This is similar to the tailwind css
    generation tools, but compleyely clojure based.

  2. Use the macro to generate css at runtime.
    If this is used with server rendered pages then this
    Will work fine I guess. I have a reagent app with lots
    Of components that may or may not be used on a
    Page. So for that I would need a css register that
    Changes dynamically the css tags that are shown based
    On different components used.

My question is: is this project up to date with the
Latest tailwind version?

Thanks

@mrmcc3
Copy link
Owner

mrmcc3 commented Feb 25, 2022

Yeah so I wrote this code prior to tailwind 1.0 when I was experimenting with css utility classes. Tailwind actually uses the same method now of only generating css for the classes it finds in the content (JIT mode).

The difference is that the official tooling uses a regex over all source content to discover the classes (which does work for the most part for clojurescript source content). With clojurescript however you can do it at compile time with macros.

My question is: is this project up to date with the
Latest tailwind version?

No. Tailwind project has evolved a LOT. I more or less used tailwind 1.0 as inspiration to design the core.match rules in transform.clj but haven't had the need or time to update. If you want the latest and greatest tailwind experience I'd just use the official tooling it's great. If you really want clojure-only tooling with the latest tailwind classes it'd be a fair bit of work to update the core.match rules

@awb99
Copy link
Author

awb99 commented Mar 8, 2022

The approach of macros is amazing. This way I could write teageny components that use taikwind utility classes, and the entire needed css could be auto generated in the browser.

My other usecase is even more dynamic: I run clojurescript scripts that generate pages in the browser. Not having to load the entire tailwind css really would speed it up.

I really want to get this done at some point. But right now I have to focus to build proper ui components in clojurescript with tailwind.

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

2 participants