From 67cc23103ce263e2b9d5497716ae0a4a2334106e Mon Sep 17 00:00:00 2001 From: Guillaume Dott Date: Thu, 12 Nov 2015 12:35:22 +0100 Subject: [PATCH] Improve style for search forms --- lib/librarix/assets/application.scss | 3 ++- lib/librarix/public/application.css | 2 +- lib/librarix/views/search.slim | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/librarix/assets/application.scss b/lib/librarix/assets/application.scss index 628e93b..834a6ff 100644 --- a/lib/librarix/assets/application.scss +++ b/lib/librarix/assets/application.scss @@ -6,7 +6,7 @@ h2 { margin-top: 0; } -body > form { +body > form #search-main { display: flex; input { @@ -20,6 +20,7 @@ body > form { input[type="text"] { flex-grow: 1; + min-width: 50px; font-size: 1.4em; padding: 5px; } diff --git a/lib/librarix/public/application.css b/lib/librarix/public/application.css index 248c8a9..1389cf0 100644 --- a/lib/librarix/public/application.css +++ b/lib/librarix/public/application.css @@ -1 +1 @@ -body{margin:10px}h2{margin-top:0}body>form{display:flex}body>form input{border-radius:0.4em;border:solid 3px #f4f4f4}body>form input[type="submit"]{background-color:#f4f4f4}body>form input[type="text"]{flex-grow:1;font-size:1.4em;padding:5px}ul{list-style-type:none;margin:0;padding:0}ul li{padding:10px 0}ul li:nth-child(even){background-color:#f4f4f4}.movie{display:flex;flex-flow:row wrap;align-items:center;justify-content:center}.movie .poster{margin-right:10px}.movie .informations{align-self:flex-start;flex:1 1 300px} +body{margin:10px}h2{margin-top:0}body>form #search-main{display:flex}body>form #search-main input{border-radius:0.4em;border:solid 3px #f4f4f4}body>form #search-main input[type="submit"]{background-color:#f4f4f4}body>form #search-main input[type="text"]{flex-grow:1;min-width:50px;font-size:1.4em;padding:5px}ul{list-style-type:none;margin:0;padding:0}ul li{padding:10px 0}ul li:nth-child(even){background-color:#f4f4f4}.movie{display:flex;flex-flow:row wrap;align-items:center;justify-content:center}.movie .poster{margin-right:10px}.movie .informations{align-self:flex-start;flex:1 1 300px} diff --git a/lib/librarix/views/search.slim b/lib/librarix/views/search.slim index 23952b3..43d94d5 100644 --- a/lib/librarix/views/search.slim +++ b/lib/librarix/views/search.slim @@ -1,8 +1,9 @@ - content_for(:title) { 'Search' } form method="get" action="/search" id="search" - input type="text" name="search" value="#{params['search']}" autocomplete="off" autofocus="on" - input type="submit" value="Search" + div id="search-main" + input type="text" name="search" value="#{params['search']}" autocomplete="off" autofocus="on" + input type="submit" value="Search" div == slim :list, locals: {movies: movies}