build: replace node/npm with tailwindcss cli (v3.4.4) #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a test for replacing node/npm with the standalone tailwindcss cli, using the new
css.Tailwind
feature introduced in hugo 0.128.0. Since css.Tailwind feature is intended for tailwind v4, which does not yet have a--config
option, I cannot directly use module mounts to mount atailwind.config.js
file provided by a theme/module. However, this PR contains a workaround where we use theHUGO_FILE_TAILWIND_CONFIG_JS
provided by hugo to find the theme'stailwind.config.js
. By having theexampleSite
(or other calling module) use a different name for the theme (e.g. tailwind.config.mjs), which is still recognized bytailwindcss
, but is not recognized by hugo, the calling site can use a thin wrapper which calls out to the theme's tailwind config.An interesting side-effect of this is that consumers of this theme will be able to override/extend the tailwind configuration without vendoring, which is actually pretty cool!