From 4ec8920b9048cb379e4a84627654f70fcf9af6b6 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Mon, 27 Mar 2023 11:36:05 +0200 Subject: [PATCH] Style adjustments for forms. --- assets/sass/_zen.scss | 7 +------ assets/sass/base/forms/_forms.scss | 9 +++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/assets/sass/_zen.scss b/assets/sass/_zen.scss index 14e87fd..342ba63 100644 --- a/assets/sass/_zen.scss +++ b/assets/sass/_zen.scss @@ -11,7 +11,7 @@ body { } .footer { - border-top: 2px solid var(--color-brand); + border-top: 2px solid var(--color-border); } // Apply smaller text to blocks, footer etc. @@ -202,11 +202,6 @@ figure { // Search -.search-input { - // Add vertical rhythm margins. - @include margin-block(1); -} - .search-text { font-size: var(--fs-l); max-width: 80%; diff --git a/assets/sass/base/forms/_forms.scss b/assets/sass/base/forms/_forms.scss index 61dfd7a..48111a3 100644 --- a/assets/sass/base/forms/_forms.scss +++ b/assets/sass/base/forms/_forms.scss @@ -18,6 +18,7 @@ select { @include margin-bottom(.75); } +// Mark field as required if needed. label { &:has(+ :required) { &::after { @@ -44,9 +45,17 @@ textarea { width: Min(30em, 100%); } +// For forms with multibple fields show submit button below the form. input:not(:only-of-type), textarea { & + [type='submit'] { display: block; } } + +// For forms with single field add space between it and the submit button. +input:only-of-type { + &:has(+ [type='submit']) { + margin-right: .5rem; + } +}