Improved form element styling

Improved article and comment styling
This commit is contained in:
Luke Barratt 2014-04-09 21:44:04 +01:00
parent 01029aea80
commit 2549698a6d
12 changed files with 71 additions and 36 deletions

View file

@ -46,8 +46,11 @@ $green: #1f7f5c;
$blue: #5a9aa8; $blue: #5a9aa8;
$purple: #6a5a8c; $purple: #6a5a8c;
$gold: #FFD700; $gold: #FFD700;
$dark-gray: #232323; $dark-gray: #232323;
$medium-gray: #2e2e2e; $medium-gray: #2e2e2e;
$light-blue: #F3F3FB;
$light-gray: #DDD; $light-gray: #DDD;
$light-red: #e56c69; $light-red: #e56c69;
$light-yellow: #FFF6BF; $light-yellow: #FFF6BF;
@ -89,11 +92,12 @@ $input-primary: white;
$input-secondary: #5a9aa8; $input-secondary: #5a9aa8;
$input-text: #232323; $input-text: #232323;
$input-border-width: em(3); $input-border-width: em(3);
$input-border-colour: darken($light-blue, 10);
$input-padding: em(11); $input-padding: em(11);
$input-dark-background-colour: $dark-gray; $input-dark-background-colour: $dark-gray;
$input-dark-border-colour: $medium-gray; $input-dark-border-colour: $light-gray;
$input-dark-border-width: em(1); $input-dark-border-width: em(2);
$input-dark-border-hover-colour: $blue; $input-dark-border-hover-colour: $blue;
$input-dark-border-focus-colour: $green; $input-dark-border-focus-colour: $green;

View file

@ -9,8 +9,9 @@
@include span-columns(12); @include span-columns(12);
margin-bottom: em(20); margin-bottom: em(20);
h3 { h5 {
margin-top: 0; margin-top: 0;
margin-bottom: 1em;
} }
.fields { .fields {

View file

@ -34,25 +34,28 @@ form {
font-size: em(16); font-size: em(16);
padding: $input-padding; padding: $input-padding;
height: em(40); height: em(40);
border: none; border: $input-border-colour solid $input-border-width;
&:hover { &:hover {
border: $input-border-width solid lighten($input-secondary, 20%); border: $input-border-width solid lighten($input-secondary, 20%);
padding: $input-padding ($input-padding - $input-border-width);
} }
&:focus { &:focus {
border: $input-border-width solid $input-secondary; border: $input-border-width solid $input-secondary;
padding: $input-padding ($input-padding - $input-border-width);
color: $input-secondary; color: $input-secondary;
outline: none; outline: none;
background: transparent; background: transparent;
} }
} }
textarea {
height: auto;
width: 100%;
}
} }
.controls { .controls {
margin-bottom: 20px; margin-bottom: em(20);
button, button,
input { input {
@ -72,12 +75,10 @@ form.dark {
&:hover { &:hover {
border: $input-dark-border-width solid $input-dark-border-hover-colour; border: $input-dark-border-width solid $input-dark-border-hover-colour;
padding: $input-padding ($input-padding - $input-dark-border-width);
} }
&:focus { &:focus {
border: $input-dark-border-width solid $input-dark-border-focus-colour; border: $input-dark-border-width solid $input-dark-border-focus-colour;
padding: $input-padding ($input-padding - $input-dark-border-width);
} }
&:-webkit-autofill { &:-webkit-autofill {

View file

@ -1,8 +1,8 @@
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
background: #046; background: lighten($blue, 10);
@include background-image(linear-gradient(#046, $medium-gray)); @include background-image(linear-gradient(lighten($blue, 10), $medium-gray));
} }
%container-padded { %container-padded {
@ -20,7 +20,7 @@ body {
#content, #content,
#forums { #forums {
@include span-columns(12); @include span-columns(12);
background: #F3F3FB; background: $light-blue;
padding-top: em(20); padding-top: em(20);
} }
@ -38,3 +38,8 @@ img.flag {
vertical-align: - em(6); vertical-align: - em(6);
margin-right: em(10); margin-right: em(10);
} }
.actions-bottom {
@include span-columns(12);
margin-top: em(20);
}

View file

@ -9,7 +9,7 @@ div.article {
.content { .content {
@include span-columns(12); @include span-columns(12);
margin-bottom: em(20); margin-bottom: em(40);
} }
.author { .author {
@ -29,3 +29,25 @@ div.article {
} }
} }
} }
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);
}
}
}

View file

@ -12,14 +12,9 @@
<% end %> <% end %>
</li> </li>
<% end %> <% end %>
<li>
<%= link_to("/gathers/latest/ns1") do %>
NS1 Gather (<%= Gather.player_count_for_game('NS1') %>)
<% end %>
</li>
<li> <li>
<%= link_to("/gathers/latest/ns2") do %> <%= 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 %> <% end %>
</li> </li>
</ul> </ul>

View file

@ -1,13 +1,18 @@
<div class="articleLinks"> <div class="article-links">
<% if article.previous_article %> <% if article.previous_article %>
<div class="left"> <div class="previous">
<%= link_to "<< #{article.previous_article}", article.previous_article %> <%= link_to article.previous_article do %>
<%= icon 'arrow-left' %>
<%= article.previous_article %>
<% end %>
</div> </div>
<% end %> <% end %>
<% if article.next_article %> <% if article.next_article %>
<div class="right"> <div class="next">
<%= link_to "#{article.next_article} >>", article.next_article %> <%= link_to article.next_article do %>
<%= article.next_article %>
<%= icon 'arrow-right' %>
<% end %>
</div> </div>
<% end %> <% end %>
</div> </div>

View file

@ -4,8 +4,10 @@
<% end %> <% end %>
</div> </div>
<div class="actions-bottom">
<%= link_to t('news.archive'), '/news/archive', class: "button" %> <%= link_to t('news.archive'), '/news/archive', class: "button" %>
<% if cuser and cuser.admin? %> <% if cuser and cuser.admin? %>
<%= link_to t('helpers.submit.post.new'), new_article_path, class: "button" %> <%= link_to t('helpers.submit.post.new'), new_article_path, class: "button" %>
<% end %> <% end %>
</div>

View file

@ -1,5 +1,5 @@
<div class="comment-form"> <div class="comment-form">
<h3>New comment</h3> <h5>New comment</h5>
<% if cuser %> <% if cuser %>
<%= form_for(@comment, remote: true) do |f| %> <%= form_for(@comment, remote: true) do |f| %>

View file

@ -1,2 +1,2 @@
$("div.commentNew").hide(); $(".comment-form").hide();
$("div.comments").append("<%= escape_javascript(render("comment", :comment => @comment)) %>"); $("#comments").append("<%= escape_javascript(render("comment", comment: @comment)) %>");

View file

@ -7,8 +7,8 @@
<div class="separator"><%= day_events.first.start.strftime("%A, %e %B") %></div> <div class="separator"><%= day_events.first.start.strftime("%A, %e %B") %></div>
<% day_events.each do |event| %> <% day_events.each do |event| %>
<div class="entry"> <div class="entry">
<p><%= event.formatted_summary %></p> <p class="summary"><%= event.formatted_summary %></p>
<p><%= event.start.strftime("%H:%M %Z") %></p> <p class="time"><%= event.start.strftime("%H:%M %Z") %></p>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

View file

@ -1,7 +1,7 @@
<%= form_tag({ controller: "users", action: "login" }, { class: "dark" }) do %> <%= form_tag({ controller: "users", action: "login" }, { class: "dark" }) do %>
<div class="fields"> <div class="fields">
<%= text_field "login", "username" %> <%= text_field "login", "username", placeholder: "Username" %>
<%= password_field "login", "password" %> <%= password_field "login", "password", placeholder: "Password" %>
</div> </div>
<div class="controls"> <div class="controls">
<%= submit_tag t('helpers.submit.user.login') %> <%= submit_tag t('helpers.submit.user.login') %>