jeudi 13 août 2015

Rails Devise & Simple Form

I am trying to make an app with Rails 4, devise and simple form.

The devise view has a standard remember me checkbox, which I am trying to format.

I read a blog post showing me how to alter the devise checkbox aligment for the remember me field (which as a standard pushes the checkbox to the left of the vertical alignment of the other fields in the form.

To fix this, I changed my framework_and_overrides.css.scss to include:

.checkbox input[type="checkbox"] {
  margin-left: 0;
}

Now, when I try to use the devise form, the checkbox appears on top of the letter 'R' in the remember me label.

Also, my css to style the words 'remember me' won't apply to that text.

My field currently has:

        <%= f.input :remember_me,  as: :boolean,  inline_label: true, :input_html => {:class => 'deviselabels'}, label: false if devise_mapping.rememberable? %>

The styling I'm trying to apply is in the 'devise labels' class - it changes the font color and size. But it isn't working on this specific form element. It works fine on the other elements in the form and doesnt alter margins:

.deviselinks {
  font-family: 'Quicksand', sans-serif;
  color: white;
    a:link {text-decoration:none; background-color:transparent; color:white;};
    a:visited {text-decoration:none;background-color:transparent; color:white;};
    a:hover {text-decoration:none;background-color:transparent; color:white;};
    a:active {text-decoration:none;background-color:transparent; color:white;};

}

Does anyone know how to move the words 'remember me' over so they are to the left of the check box (rather than the 'R' being underneath the checkbox)? Also, how do I apply my font styling to the words 'Remember me'?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire