Commit a5cf65d0d928a6ac5ca23d3173755b0489a9d250
1 parent
51a6bc04
Exists in
master
and in
1 other branch
Add focus styles to forms
Showing
2 changed files
with
11 additions
and
3 deletions
Show diff stats
app/views/devise/sessions/new.html.haml
... | ... | @@ -3,15 +3,15 @@ |
3 | 3 | = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| |
4 | 4 | .required |
5 | 5 | = f.label :email |
6 | - = f.text_field :email | |
6 | + = f.text_field :email, :tabindex => 1 | |
7 | 7 | .required |
8 | 8 | = link_to 'forget it?', new_password_path(resource_name), :class => 'float-right' |
9 | 9 | = f.label :password |
10 | - = f.password_field :password | |
10 | + = f.password_field :password, :tabindex => 2 | |
11 | 11 | |
12 | 12 | - if devise_mapping.rememberable? |
13 | 13 | %div.checkbox |
14 | - = f.check_box :remember_me | |
14 | + = f.check_box :remember_me, :tabindex => 3 | |
15 | 15 | = f.label :remember_me |
16 | 16 | |
17 | 17 | %div= f.submit "Sign in" |
18 | 18 | \ No newline at end of file | ... | ... |
public/stylesheets/application.css
... | ... | @@ -239,6 +239,14 @@ form textarea { |
239 | 239 | } |
240 | 240 | form textarea.short { height: 8em; } |
241 | 241 | form textarea.supershort { height: 4em; } |
242 | +form input[type=text]:focus, form input[type=password]:focus, form textarea:focus { | |
243 | + box-shadow: 0px 0px 4px #69C; | |
244 | + -moz-box-shadow: 0px 0px 4px #69C; | |
245 | + -webkit-box-shadow: 0px 0px 4px #69C | |
246 | +} | |
247 | +form input[type=checkbox]:focus + label{ | |
248 | + color: #69C; | |
249 | +} | |
242 | 250 | form input[type=submit] { |
243 | 251 | display:block; width: auto; padding: 0.5em; |
244 | 252 | font-size: 1.2em; line-height: 1em; text-transform: uppercase; | ... | ... |