Hugo Dark Theme Site Generator https://after-dark.habd.as
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hackcss-button.html 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!-- {{/*
  2. Permitted attributes: "type", "text", "isghost", "isblock", "action", "onclick", "tabindex", "target", "method"
  3. Available types: [default], "primary", "success", "info", "warning", "error"
  4. Basic usage:
  5. {{< hackcss-button text="Default" />}}
  6. {{< hackcss-button text="Info" type="info" />}}
  7. {{< hackcss-button text="Default Ghost" isghost="true" />}}
  8. {{< hackcss-button text="Block Level Button" isblock="true" />}}
  9. {{< hackcss-button text="Primary Ghost" type="primary" isghost="true" />}}
  10. Inner usage:
  11. {{< hackcss-button type="error" >}}<b>ABORT</b>{{< /hackcss-button >}}
  12. {{% hackcss-button type="success" %}}**Purchase**{{% /hackcss-button %}}
  13. With loading indicator:
  14. {{< hackcss-button >}}
  15. Please wait&hellip; {{< hackcss-throbber >}}
  16. {{< /hackcss-button >}}
  17. Inside a button group:
  18. {{< hackcss-buttongroup >}}
  19. {{< hackcss-button text="Default Action" isghost="true" />}}
  20. {{< hackcss-button text="Custom Action" action="/go/elsewhere" />}}
  21. {{< hackcss-button text="Custom Target" target="_blank" tabindex="-1" />}}
  22. {{< hackcss-button text="Custom Method" method="get" />}}
  23. {{< /hackcss-buttongroup >}}
  24. */}} -->
  25. {{ $type := .Get "type" }}
  26. {{ $body := .Get "text" | default .Inner }}
  27. {{ $isghost := .Get "isghost" }}
  28. {{ $isblock := .Get "isblock" }}
  29. {{ $action := .Get "action" }}
  30. {{ $onclick := .Get "onclick" }}
  31. {{ $tabindex := .Get "tabindex" }}
  32. {{ $target := .Get "target" }}
  33. {{ $method := .Get "method" }}
  34. {{ partial "components/button.html" (dict "type" $type "body" $body "isghost" $isghost "isblock" $isblock "action" $action "onclick" $onclick "tabindex" $tabindex "target" $target "method" $method) }}