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,15 +3,15 @@ | ||
| 3 | = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| | 3 | = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| |
| 4 | .required | 4 | .required |
| 5 | = f.label :email | 5 | = f.label :email |
| 6 | - = f.text_field :email | 6 | + = f.text_field :email, :tabindex => 1 |
| 7 | .required | 7 | .required |
| 8 | = link_to 'forget it?', new_password_path(resource_name), :class => 'float-right' | 8 | = link_to 'forget it?', new_password_path(resource_name), :class => 'float-right' |
| 9 | = f.label :password | 9 | = f.label :password |
| 10 | - = f.password_field :password | 10 | + = f.password_field :password, :tabindex => 2 |
| 11 | 11 | ||
| 12 | - if devise_mapping.rememberable? | 12 | - if devise_mapping.rememberable? |
| 13 | %div.checkbox | 13 | %div.checkbox |
| 14 | - = f.check_box :remember_me | 14 | + = f.check_box :remember_me, :tabindex => 3 |
| 15 | = f.label :remember_me | 15 | = f.label :remember_me |
| 16 | 16 | ||
| 17 | %div= f.submit "Sign in" | 17 | %div= f.submit "Sign in" |
| 18 | \ No newline at end of file | 18 | \ No newline at end of file |
public/stylesheets/application.css
| @@ -239,6 +239,14 @@ form textarea { | @@ -239,6 +239,14 @@ form textarea { | ||
| 239 | } | 239 | } |
| 240 | form textarea.short { height: 8em; } | 240 | form textarea.short { height: 8em; } |
| 241 | form textarea.supershort { height: 4em; } | 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 | form input[type=submit] { | 250 | form input[type=submit] { |
| 243 | display:block; width: auto; padding: 0.5em; | 251 | display:block; width: auto; padding: 0.5em; |
| 244 | font-size: 1.2em; line-height: 1em; text-transform: uppercase; | 252 | font-size: 1.2em; line-height: 1em; text-transform: uppercase; |