From eef9e6b7eab4116c110dd1428cbba6e2a1f4f5c3 Mon Sep 17 00:00:00 2001 From: Bat Date: Wed, 18 Jul 2018 15:34:18 +0200 Subject: [PATCH] Better style for form errors --- static/main.css | 15 +++++++++++---- templates/posts/new.html.tera | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/static/main.css b/static/main.css index a256af45..830da762 100644 --- a/static/main.css +++ b/static/main.css @@ -1,3 +1,5 @@ +/* color palette: https://coolors.co/23f0c7-ef767a-7765e3-6457a6-ffe347 */ + @import url('/static/fonts/Route159/Route159.css'); @import url('/static/fonts/Lora/Lora.css'); @import url('/static/fonts/Playfair_Display/PlayfairDisplay.css'); @@ -370,6 +372,15 @@ input[type="submit"] { display: block; } color: white; } +/* Errors */ + +p.error { + color: #ef767a; + font-weight: bold; + max-width: 40rem; + margin: 1em auto; +} + /* * == New post == */ @@ -389,10 +400,6 @@ form.new-post textarea { min-height: 20em; } form.new-post input[type="submit"] { - /*transition: all 0.2s ease; - display: block; - margin: 1em auto;*/ - background: #ECECEC; color: #242424; border: none; diff --git a/templates/posts/new.html.tera b/templates/posts/new.html.tera index f42f2e15..e4298b53 100644 --- a/templates/posts/new.html.tera +++ b/templates/posts/new.html.tera @@ -8,7 +8,7 @@ {% block content %}

{{ "Create a post" | _ }}

- {{ macros::input(name="title", label="Title", errors=errors, form=form) }} + {{ macros::input(name="title", label="Title", errors=errors, form=form, props="required") }} {% if errors is defined and errors.content %} {% for err in errors.content %}