diff options
author | Alexandre Negrel <negrel.dev@protonmail.com> | 2021-01-26 23:27:27 +0300 |
---|---|---|
committer | Alexandre Negrel <negrel.dev@protonmail.com> | 2021-01-26 23:27:27 +0300 |
commit | 1d342dc29608c7d786b0fa5e27b5f2e6d8e4376d (patch) | |
tree | 0164719c8df9ce9ae9e90b60133c2931388c16b1 | |
parent | 63ec7e9d734983dfdc6f884c168c90c2bc3bd72b (diff) |
adding dark mode support for contact form
-rw-r--r-- | layouts/partials/widgets/contact_form.html | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/layouts/partials/widgets/contact_form.html b/layouts/partials/widgets/contact_form.html index 16eb14f..eacda8a 100644 --- a/layouts/partials/widgets/contact_form.html +++ b/layouts/partials/widgets/contact_form.html @@ -35,29 +35,32 @@ </label> </div> {{ end }} + {{ $class := "bg-secondary-light border-secondary focus:border-accent" }} {{ if eq .type "textarea" }} <textarea rows="5" {{ printf "name=%q" .name | safeHTMLAttr }} {{ printf "id=%q" .name | safeHTMLAttr }} - {{ printf "placeholder=%q" .placeholder | safeHTMLAttr }} {{ $minlength }} {{ $maxlength }}></textarea> + {{ printf "placeholder=%q" .placeholder | safeHTMLAttr }} {{ $minlength }} {{ $maxlength }} + {{ printf "class='%s'" $class | safeHTMLAttr }}></textarea> {{ else }} {{ $type := .type | default "text" }} <input {{ printf "type=%q" .type | safeHTMLAttr }} {{ printf "name=%q" .name | safeHTMLAttr }} {{ printf "id=%q" .name | safeHTMLAttr }} {{ printf "placeholder=%q" .placeholder | safeHTMLAttr }} - {{ $pattern }} {{ if .required }} required {{ end }}> + {{ $pattern }} {{ if .required }} required {{ end }} + {{ printf "class='%s'" $class | safeHTMLAttr }}> {{ end }} </div> {{ end }} {{ if .Params.useEmail }} {{ with .Site.Params.email }} - <a class="bg-gray-200 px-3 py-2 rounded-md mr-2 no-underline inline-block" href="mailto:{{ . }}"> + <a class="bg-secondary-dark dark:bg-secondary-light px-3 py-2 rounded-md mr-2 no-underline inline-block" href="mailto:{{ . }}"> {{ i18n "contact_email" }} </a> {{ end }} {{ end }} <div class="float-right"> - <input type="reset" class="bg-gray-200 mr-2" value='{{ i18n "cancel" }}' /> - <input type="submit" class="bg-black text-white" value='{{ i18n "submit" }}' /> + <input type="reset" class="bg-secondary-dark dark:bg-secondary-light mr-2" value='{{ i18n "cancel" }}' /> + <input type="submit" class="bg-primary text-secondary" value='{{ i18n "submit" }}' /> </div> </form> </section>
\ No newline at end of file |