chore(templates): component-ize things
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
14
templates/components/button.tmpl
Normal file
14
templates/components/button.tmpl
Normal file
@@ -0,0 +1,14 @@
|
||||
<!-- 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 }}
|
||||
{{ else }}
|
||||
{{ $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>
|
||||
{{ else }}
|
||||
<button class="{{ $baseClass }}" type="submit" {{ if .FormName }} form="{{ .FormName}}" {{ end }}>{{ .Title }}
|
||||
</button>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user