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-textinput.html 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!-- {{/*
  2. HTML attributes: "id", "name", "class", "autocomplete", "autofocus", "disabled", "form", "formaction", "formmethod", "formtarget", "height", "max", "maxlength", "min", "minlength", "multiple", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "tabindex", "type", "value", "width"
  3. Possible types: "email", "hidden", "number", "password", "search", "tel", "text", "url"
  4. Basic usage:
  5. {{< hackcss-textinput >}}
  6. {{< hackcss-textinput type="password" >}}
  7. {{< hackcss-textinput type="email" placeholder="name@domain.example" >}}
  8. {{< hackcss-textinput disabled="true" >}}
  9. With control label and search input targeting form owner:
  10. {{< hackcss-formgroup >}}
  11. {{< hackcss-label for="query" text="Enter search query:" />}}
  12. {{< hackcss-textinput type="search" id="query" form="search" >}}
  13. {{< /hackcss-formgroup >}}
  14. Required with placeholder text and custom regex validation:
  15. {{< hackcss-form autocomplete="disabled" >}}
  16. {{< hackcss-textinput
  17. placeholder="associate-20"
  18. name="AssociateTag"
  19. pattern="^\b\w*\b-20$" >}}
  20. {{< /hackcss-form >}}
  21. Inside form group with warning label and help block:
  22. {{< hackcss-formgroup state="warning" >}}
  23. {{< hackcss-label for="key64" text="64-bit PGP key:" />}}
  24. {{< hackcss-textinput type="text" id="key64" >}}
  25. {{< hackcss-helpblock text="In this format: BB73 67EE 9A70 A631" />}}
  26. {{< /hackcss-formgroup >}}
  27. */}} -->
  28. {{ $id := .Get "id" }}
  29. {{ $name := .Get "name" }}
  30. {{ $class := .Get "class" }}
  31. {{ $autocomplete := .Get "autocomplete" }}
  32. {{ $autofocus := .Get "autofocus" }}
  33. {{ $disabled := .Get "disabled" }}
  34. {{ $form := .Get "form" }}
  35. {{ $formaction := .Get "formaction" }}
  36. {{ $formmethod := .Get "formmethod" }}
  37. {{ $formtarget := .Get "formtarget" }}
  38. {{ $height := .Get "height" }}
  39. {{ $max := .Get "max" }}
  40. {{ $maxlength := .Get "maxlength" }}
  41. {{ $min := .Get "min" }}
  42. {{ $minlength := .Get "minlength" }}
  43. {{ $multiple := .Get "multiple" }}
  44. {{ $pattern := .Get "pattern" }}
  45. {{ $placeholder := .Get "placeholder" }}
  46. {{ $readonly := .Get "readonly" }}
  47. {{ $required := .Get "required" }}
  48. {{ $size := .Get "size" }}
  49. {{ $spellcheck := .Get "spellcheck" }}
  50. {{ $step := .Get "step" }}
  51. {{ $tabindex := .Get "tabindex" }}
  52. {{ $type := .Get "type" }}
  53. {{ $value := .Get "value" }}
  54. {{ $width := .Get "width" }}
  55. {{ partial "components/textinput.html" (dict "attrs" (dict "id" $id "name" $name "class" $class "autocomplete" $autocomplete "autofocus" $autofocus "disabled" $disabled "form" $form "formaction" $formaction "formmethod" $formmethod "formtarget" $formtarget "height" $height "max" $max "maxlength" $maxlength "min" $min "minlength" $minlength "multiple" $multiple "pattern" $pattern "placeholder" $placeholder "readonly" $readonly "required" $required "size" $size "spellcheck" $spellcheck "step" $step "tabindex" $tabindex "type" $type "value" $value "width" $width)) }}