chore(templates): prettier plugin & tables

This commit is contained in:
2024-06-16 17:08:10 -04:00
parent 77527bfb05
commit f37bff365f
12 changed files with 168 additions and 106 deletions

View File

@@ -1,14 +1,21 @@
<!-- Variant -->
{{ $baseClass := "transition duration-100 ease-in font-medium w-full h-full px-2 py-1 text-white" }}
{{ if eq .Variant "Secondary" }}
{{ $baseClass = printf "bg-black shadow-md hover:text-black hover:bg-white %s" $baseClass }}
{{ $baseClass = printf "bg-black shadow-md hover:text-black hover:bg-white %s" $baseClass }}
{{ else }}
{{ $baseClass = printf "bg-gray-500 dark:text-gray-800 hover:bg-gray-800 dark:hover:bg-gray-100 %s" $baseClass }}
{{ $baseClass = printf "bg-gray-500 dark:text-gray-800 hover:bg-gray-800 dark:hover:bg-gray-100 %s" $baseClass }}
{{ end }}
<!-- Type -->
{{ if eq .Type "Link" }}
<a href="{{ .URL }}" class="text-center {{ $baseClass }}" type="submit">{{ .Title }}</a>
<a href="{{ .URL }}" class="text-center {{ $baseClass }}" type="submit"
>{{ .Title }}</a
>
{{ else }}
<button class="{{ $baseClass }}" type="submit" {{ if .FormName }} form="{{ .FormName}}" {{ end }}>{{ .Title }}
</button>
<button
class="{{ $baseClass }}"
type="submit"
{{ if .FormName }}form="{{ .FormName }}"{{ end }}
>
{{ .Title }}
</button>
{{ end }}