Closed 4l1fe closed 6 months ago
Does the plugin take into account such the case? The result i got using plugin seems to be not contained the dynamic css classes.
No, as a Python SSG, it's natural we can't use the full power of tailwindcss
Does the plugin take into account such the case? The result i got using plugin seems to be not contained the dynamic css classes.
No, as a Python SSG, it's natural we can't use the full power of tailwindcss
But what about handling other events after-build
or after-build-all
instead of on_before_build
, will it work if i manually change plugin locally?
Does tailwindcss watch
work as expected?
Does
tailwindcss watch
work as expected?
Only if it watches the final artifacts, not jinja templates, because in jinja templates css classes are jinja variables. In the final html files those css classes are rendered so tailwindcss watch
can indetify them and include into the style.css
. Due to that, i asked whetherthe plugin be modified to do its feature during other event when the final artifacts are built.
I see, but the watch files are configured in tailwindcss.config.js
.
So let me clarify, in lektor serve
, since tailwind is started in watching mode, as long as tailwindcss is configured correctly, it can be rendered correctly
However in lektor build
, since the hook is run in before_build
stage, it can't collect the files under build folder. Is that right?
So let me clarify, in lektor serve, since tailwind is started in watching mode, as long as tailwindcss is configured correctly, it can be rendered correctly
That's not correct for the specific case when you have dynamic variables of css classes. tailwindcss
has no clue of how to interpret those variables(example in the first post).
However in lektor build, since the hook is run in before_build stage, it can't collect the files under build folder. Is that right?
All is fine with collecting.
tailwindcss
has no clue of how to interpret those variables(example in the first post).
Wouldn't it be able to collect the files in build
dir as well?
Running into the same issue. The problem is that the watcher is configured to look at the templates, rather than the build output, so tailwindcss
never sees the final HTML files, and thus can't see any class names dynamically generated by Jinja. Since by default the build folder is not located in the source dir, this cannot be easily solved by just changing the content
config key; the plugin would need to expose the location of build
in a way that can be referred to easily in the config.
Hey, in my case there are a couple of colors i input in model fields interactively to include them in html later on. It looks like:
The problem is that
tailwindcss
can't find the final state of html classes BEFORE all the artifacts(html files) have been built. Manually i do for it:lektor build
tailwindcss
to inspectbuild
folder for built htmls.npx tailwindcss --input input.css --output build/static/style.css
Does the plugin take into account such the case? The result i got using plugin seems to be not contained the dynamic css classes.