Skip to content

Commit

Permalink
Merge pull request #58 from theNewDynamic/tailwind-jit
Browse files Browse the repository at this point in the history
WIP: Add tailwind-jit transformation
  • Loading branch information
regisphilibert committed Mar 30, 2022
2 parents b43048c + c7b25e7 commit 3e88d49
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 3e88d49

Please sign in to comment.