Skip to content

Commit

Permalink
WIP: Add tailwind-jit transformation
Browse files Browse the repository at this point in the history
This will essentially use the current best workaround to run Hugo Pipe + JIT

Addresses #43
  • Loading branch information
regisphilibert committed Feb 11, 2022
1 parent a213ea1 commit 6e8adfe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/styles/private/GetTransformations.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- PostCSS
- PostProcess
- tailwind
- tailwind-jit
- toCSS

@author @regisphilibert
Expand All @@ -35,6 +36,8 @@
{{ with .use }}
{{ if in . "tailwind" }}
{{ $transformations = $transformations | append (slice "tailwind" "PostCSS") }}
{{ else if in . "tailwind-jit" }}
{{ $transformations = $transformations | append (slice "tailwind" "tailwind-jit" "PostCSS") }}
{{ else }}
{{ if in . "postcss" }}
{{ $transformations = $transformations | append "PostCSS" }}
Expand Down
9 changes: 9 additions & 0 deletions core/styles/private/transform/tailwind-jit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{/*
For now a workaround, as Hugo is not yet supporting Tailwind-JIT.
See https://dev.to/jonas_duri/how-to-use-tailwindcss-30-without-external-npm-scripts-just-hugo-pipes-2lg9 from @Gioni06
*/}}
{{ $resource := . }}
{{ if site.IsServer }}
{{ $resource = . | resources.ExecuteAsTemplate (printf "tailwind.dev.%v.css" now.UnixMilli) . }}
{{ end }}
{{ return $resource }}

0 comments on commit 6e8adfe

Please sign in to comment.