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
Add runtime compile of tailwind css #30
Add runtime compile of tailwind css #30
Conversation
569ed34
to
95cbece
Compare
00bd6be
to
1e38350
Compare
@ryanwinchester we're starting to review this PR. Can you swap |
To avoid changing application env vars on the fly, and also retain async on the tests, we should be able to set the |
Yeah, thanks. That's a lot better. I never use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ryanwinchester an initial review to help getting the PR done.
/edit you could also add tailwind.install
in the setup
alias
Line 50 in 5a169f6
setup: ["deps.get", "ecto.setup"], |
63eb77c
to
5751914
Compare
Switch to mox and add the required ceremonial code Remove application env setting in test for CSS and Mox
5751914
to
f2103c4
Compare
Hey @ryanwinchester seems like it's missing the loading of beacon/lib/beacon_web/templates/layout/root.html.heex Lines 7 to 9 in d0a75a5
|
@leandrocp Yeah I had mentioned in previous discussions that I was adding the compiled CSS to the assigns but didn't know where those were being used and how to get the CSS into the actual rendered layout, but never really got an answer. So, just assumed it would be resolved later 😂. |
Ohh gotcha 😂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about #30 (comment) but it LGTM.
Great work!
3dff779
to
95a2779
Compare
ab090ae
to
d3e9263
Compare
7ea8947
to
f25dd80
Compare
Co-authored-by: Leandro Pereira <leandro@leandro.io>
Thanks!! |
This adds
Beacon.RuntimeCSS.recompile!/1
It recompiles and minifies/purges Tailwind CSS based on layout and pages from the DB.
TODO (and to discuss):
NOTE: This adds the CSS to assigns in the module loader but not to any rendered pages. My main goal was getting CSS that could compile/recompile at runtime.
Also, there are also probably better ways to handle custom tailwind configs, but this is a starting point?