Skip to content

Commit

Permalink
Fix FromString using the .Name as published path. Result was a css fi…
Browse files Browse the repository at this point in the history
…le with scss extension.
  • Loading branch information
regisphilibert committed Sep 2, 2021
1 parent a2b7c4c commit 67dcefd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/styles/private/transform/tailwind.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@
@tailwind components;
@tailwind utilities;
` .Content }}
{{ $resource := $tailwind | resources.FromString .Name }}

{{/* .FromString takes a path, we can't rely on the .Name's as it may include `.scss` extnesion,
even after having been transformed to css by .toCSS.
We therfore replace .Name extension with css and use the resulted string as path.
*/}}
{{ $path := replace .Name (path.Ext .Name) ".css" }}
{{ $resource := $tailwind | resources.FromString $path }}

{{ return $resource }}

0 comments on commit 67dcefd

Please sign in to comment.