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-formgroup.html 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. <!-- {{/*
  2. HTML attributes: "disabled", "form", "name", "class", "legend", "body"
  3. Custom attributes: "hastextarea", "state"
  4. Possible states: "success", "warning", "error"
  5. Basic example:
  6. {{< hackcss-formgroup >}}
  7. {{< hackcss-label for="query" text="Query:" />}}
  8. {{< hackcss-textinput id="query" type="search" >}}
  9. {{< /hackcss-formgroup >}}
  10. With text area:
  11. {{< hackcss-formgroup hastextarea="true" >}}
  12. {{< hackcss-label for="message" text="Message:" >}}
  13. {{< hackcss-textarea id="message" rows="10" >}}
  14. {{< /hackcss-formgroup >}}
  15. With legend and helper text:
  16. {{< hackcss-formgroup legend="Personal Information" >}}
  17. {{< hackcss-label for="phone" text="Phone Number:" />}}
  18. {{< hackcss-textinput id="phone" type="tel" value="+86 180 800 8000" >}}
  19. {{< hackcss-helpblock text="In this format: +86 xxx xxx xxxxx" />}}
  20. {{< /hackcss-formgroup >}}
  21. */}} -->
  22. {{ $hastextarea := .Get "hastextarea" }}
  23. {{ $state := .Get "state" }}
  24. {{ $disabled := .Get "disabled" }}
  25. {{ $form := .Get "form" }}
  26. {{ $name := .Get "name" }}
  27. {{ $class := .Get "class" }}
  28. {{ $legend := .Get "legend" }}
  29. {{ $body := .Get "body" | default .Inner }}
  30. {{ partial "components/formgroup.html" (dict "hastextarea" $hastextarea "state" $state "class" $class "disabled" $disabled "form" $form "name" $name "legend" $legend "body" $body) }}