From 63ec5d86fa25f28c498ab15d0b799308da36655c Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Wed, 9 Apr 2014 21:44:04 +0100 Subject: [PATCH] Improved form element styling Improved article and comment styling --- app/assets/stylesheets/_variables.scss | 8 +++++-- .../stylesheets/components/_comments.scss | 3 ++- app/assets/stylesheets/components/_forms.scss | 13 +++++----- app/assets/stylesheets/layout/_body.scss | 11 ++++++--- app/assets/stylesheets/pages/_news.scss | 24 ++++++++++++++++++- app/views/application/_header.html.erb | 7 +----- app/views/articles/_top.html.erb | 17 ++++++++----- app/views/articles/news_index.html.erb | 10 ++++---- app/views/comments/_new.html.erb | 2 +- app/views/comments/create.js.erb | 4 ++-- app/views/widgets/_calendar.html.erb | 4 ++-- app/views/widgets/_login.html.erb | 4 ++-- 12 files changed, 71 insertions(+), 36 deletions(-) diff --git a/app/assets/stylesheets/_variables.scss b/app/assets/stylesheets/_variables.scss index 2424d05..168778d 100644 --- a/app/assets/stylesheets/_variables.scss +++ b/app/assets/stylesheets/_variables.scss @@ -46,8 +46,11 @@ $green: #1f7f5c; $blue: #5a9aa8; $purple: #6a5a8c; $gold: #FFD700; + $dark-gray: #232323; $medium-gray: #2e2e2e; + +$light-blue: #F3F3FB; $light-gray: #DDD; $light-red: #e56c69; $light-yellow: #FFF6BF; @@ -89,11 +92,12 @@ $input-primary: white; $input-secondary: #5a9aa8; $input-text: #232323; $input-border-width: em(3); +$input-border-colour: darken($light-blue, 10); $input-padding: em(11); $input-dark-background-colour: $dark-gray; -$input-dark-border-colour: $medium-gray; -$input-dark-border-width: em(1); +$input-dark-border-colour: $light-gray; +$input-dark-border-width: em(2); $input-dark-border-hover-colour: $blue; $input-dark-border-focus-colour: $green; diff --git a/app/assets/stylesheets/components/_comments.scss b/app/assets/stylesheets/components/_comments.scss index 1f1c6a2..bc7dfcc 100644 --- a/app/assets/stylesheets/components/_comments.scss +++ b/app/assets/stylesheets/components/_comments.scss @@ -9,8 +9,9 @@ @include span-columns(12); margin-bottom: em(20); - h3 { + h5 { margin-top: 0; + margin-bottom: 1em; } .fields { diff --git a/app/assets/stylesheets/components/_forms.scss b/app/assets/stylesheets/components/_forms.scss index fc04b13..fd8e7bb 100644 --- a/app/assets/stylesheets/components/_forms.scss +++ b/app/assets/stylesheets/components/_forms.scss @@ -34,25 +34,28 @@ form { font-size: em(16); padding: $input-padding; height: em(40); - border: none; + border: $input-border-colour solid $input-border-width; &:hover { border: $input-border-width solid lighten($input-secondary, 20%); - padding: $input-padding ($input-padding - $input-border-width); } &:focus { border: $input-border-width solid $input-secondary; - padding: $input-padding ($input-padding - $input-border-width); color: $input-secondary; outline: none; background: transparent; } } + + textarea { + height: auto; + width: 100%; + } } .controls { - margin-bottom: 20px; + margin-bottom: em(20); button, input { @@ -72,12 +75,10 @@ form.dark { &:hover { border: $input-dark-border-width solid $input-dark-border-hover-colour; - padding: $input-padding ($input-padding - $input-dark-border-width); } &:focus { border: $input-dark-border-width solid $input-dark-border-focus-colour; - padding: $input-padding ($input-padding - $input-dark-border-width); } &:-webkit-autofill { diff --git a/app/assets/stylesheets/layout/_body.scss b/app/assets/stylesheets/layout/_body.scss index 68a1117..ea835c7 100644 --- a/app/assets/stylesheets/layout/_body.scss +++ b/app/assets/stylesheets/layout/_body.scss @@ -1,8 +1,8 @@ body { margin: 0; padding: 0; - background: #046; - @include background-image(linear-gradient(#046, $medium-gray)); + background: lighten($blue, 10); + @include background-image(linear-gradient(lighten($blue, 10), $medium-gray)); } %container-padded { @@ -20,7 +20,7 @@ body { #content, #forums { @include span-columns(12); - background: #F3F3FB; + background: $light-blue; padding-top: em(20); } @@ -38,3 +38,8 @@ img.flag { vertical-align: - em(6); margin-right: em(10); } + +.actions-bottom { + @include span-columns(12); + margin-top: em(20); +} \ No newline at end of file diff --git a/app/assets/stylesheets/pages/_news.scss b/app/assets/stylesheets/pages/_news.scss index ce00f6b..1b82c92 100644 --- a/app/assets/stylesheets/pages/_news.scss +++ b/app/assets/stylesheets/pages/_news.scss @@ -9,7 +9,7 @@ div.article { .content { @include span-columns(12); - margin-bottom: em(20); + margin-bottom: em(40); } .author { @@ -28,4 +28,26 @@ div.article { margin-top: 0; } } +} + +div.article-links { + @include span-columns(12); + + .previous { + @include span-columns(6); + + .fa { + padding-right: em(10); + } + } + + .next { + @include span-columns(6); + @include omega; + text-align: right; + + .fa { + padding-left: em(10); + } + } } \ No newline at end of file diff --git a/app/views/application/_header.html.erb b/app/views/application/_header.html.erb index 2824a52..6a73a1c 100644 --- a/app/views/application/_header.html.erb +++ b/app/views/application/_header.html.erb @@ -12,14 +12,9 @@ <% end %> <% end %> -
  • - <%= link_to("/gathers/latest/ns1") do %> - NS1 Gather (<%= Gather.player_count_for_game('NS1') %>) - <% end %> -
  • <%= link_to("/gathers/latest/ns2") do %> - NS2 Gather (<%= Gather.player_count_for_game('NS2') %>) + NS2 Gather (<%= Gather.player_count_for_game('NS2') %>/<%= Gather::FULL %>) <% end %>
  • diff --git a/app/views/articles/_top.html.erb b/app/views/articles/_top.html.erb index 32b52c0..35cd808 100644 --- a/app/views/articles/_top.html.erb +++ b/app/views/articles/_top.html.erb @@ -1,13 +1,18 @@ -