thetron / css3buttons_rails_helpers

Rails helpers to generate beautiful css3 buttons, based on the 'css3-github-buttons'
http://nicolasgallagher.com/lab/css3-github-buttons/
MIT License
311 stars 29 forks source link

Formtastic compatibility #25

Closed Nerian closed 9 years ago

Nerian commented 13 years ago

Hi,

I am using css3buttons_rails_helpers with formtastic and I am having some issues. The submit button doesn't look right.

I'm using Rails 3.1

application.css

/*
 * This is a manifest file that'll automatically include all the stylesheets available in this directory
 * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
 * the top of the compiled file, but it's generally better to create a new file per style scope.
 *= require_self
 *= require_tree . 
 *= require formtastic
 *= require my_formtastic_changes
 *= require css3buttons/without-reset
*/

my_formtastic_changes.css

form.formtastic input.button, form.formtastic.button.button {
  height: 25px;
  padding: 0.2em 1em 0.2em 2.5em;
  font-family: sans-serif;
  font-size: 11px;
  margin-left: 5px;
}

The problematic code:

= semantic_form_for @mentor do |f|
  = f.input :name
  = f.commit_button 'Save new mentor'

This is what I see:

http://dl.dropbox.com/u/834494/screenshot.png

Nerian commented 13 years ago

This css code fixes the issue. I can make a pull request if you want.

form.formtastic input.button {
  height: 25px;
  padding: 0.2em 1em 0.2em 1em;
  font-family: sans-serif;
  font-size: 11px;
  margin-left: 0px;
}

form.formtastic li.commit.button{
    margin: 0;
    padding: 0;     
    border: 0;
    border-radius: 0;
}
thetron commented 12 years ago

THanks @Nerian for following up on this. I'd like to try and avoid including formastic-specific (or any other library) fixes - however I will update the readme (or maybe a wiki page might be better?) to include your expanded patch.