From 851833373cbd005f21010a132007f75dd89acdde Mon Sep 17 00:00:00 2001 From: Jeff Landfried Date: Wed, 25 Jul 2018 16:41:56 -0400 Subject: [PATCH 1/2] basic form validation styles --- .../scaffold/scss/components/_form.scss | 44 +++++++++++++++++++ web/themes/custom/scaffold/scss/style.scss | 1 + 2 files changed, 45 insertions(+) create mode 100644 web/themes/custom/scaffold/scss/components/_form.scss diff --git a/web/themes/custom/scaffold/scss/components/_form.scss b/web/themes/custom/scaffold/scss/components/_form.scss new file mode 100644 index 0000000..137ac21 --- /dev/null +++ b/web/themes/custom/scaffold/scss/components/_form.scss @@ -0,0 +1,44 @@ +$form-error-red: #e62600; +$form-error-dark-red: #a51b00; + +.field--widget-options-buttons > fieldset > legend > span.form-required, +label.form-required { + &:after { + content: '*'; + color: $form-error-red; + display: inline; + padding-left: rem-calc(3); + } +} + +.form-item { + .description.error { + margin-top: 0; + color: $form-error-dark-red; + } + input, + textarea, + select { + &.error { + border-width: 1px; + border-color: $form-error-red; + background-color: hsla(15, 75%, 97%, 1); + box-shadow: inset 0 5px 5px -5px #b8b8b8; + color: $form-error-dark-red; + &:focus { + border-color: $form-error-red; + outline: 0; + box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 0 2px 0 $form-error-red; + background-color: #fcf4f2; + } + } + } + + textarea.error + .cke { + border-width: 1px; + border-color: $form-error-red; + .cke_contents { + background-color: hsla(15, 75%, 97%, 1); + } + } +} diff --git a/web/themes/custom/scaffold/scss/style.scss b/web/themes/custom/scaffold/scss/style.scss index 3b8a20c..c90ccae 100644 --- a/web/themes/custom/scaffold/scss/style.scss +++ b/web/themes/custom/scaffold/scss/style.scss @@ -21,6 +21,7 @@ button, input[type="submit"], input[type="reset"] { // Import components. @import "components/logo"; +@import "components/form"; // @import "components/navigation"; From e00c74ae9ba0e7880868de59824428a965f35bfe Mon Sep 17 00:00:00 2001 From: Jeff Landfried Date: Wed, 25 Jul 2018 16:42:30 -0400 Subject: [PATCH 2/2] add changelog note --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f762231..aea6243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] ### Changed +* Added basic form validation styling. * Enabled Drupal js behaviors in Mannequin by default. * Remove dockerized settings in default.settings.php - this file will be used whenever KernelTestBase is executed, causing the site under test to pick up the Dockerized/local settings as it's own. * Use `CACHE_HOST`, `CACHE_PORT`, `CACHE_PASSWORD` in `settings.docker.php` instead of REDIS_* equivalents. This brings us into line with Pantheon's environment variables.