CSS styling in Simple Form with Bootstrap

55 views
Skip to first unread message

Melanie M

unread,
Aug 25, 2014, 5:08:48 AM8/25/14
to plataformate...@googlegroups.com
Hello,

There has to be a simple answer for this, but I have spent 4 hours this afternoon, unsuccessfully searching for resources to help figure out how to style forms made with simple form in a bootstrap rails 4 app.

I have a simple form bootstrap initialiser.

The attached screen shot shows just how ugly and squished the standard radio boxes are rendered.

I have this line in my code:

   <%= f.label  :project_image, 'Would you like add an image to your project pitch?' %> <br>
   <%= f.collection_radio_buttons :project_image, [[true, 'Yes'] ,[false, 'No']], :first, :last, {}, {:class => "createproject"}  %>

The div 'createproject' is defined in my css.scss folder as:

.createproject {
  .font-weight: normal;
  .padding-right: 20px;
}

That styling isn't being applied to this form at all. In any event, how do I add padding to the individual components of the radio buttons line. I'd like there to be space between the button and the label and then more space again between the two options (yes /no). My form doesn't at all render like the example app in the simple form git file. I can't figure out how to add styling at all. I would be more than happy with the default styling that the git example app from simple form - but that isn't what's being produced in this code.

Please help! It's driving me crazy.

Thank you

Screen Shot 2014-08-25 at 6.57.02 pm.png

Carlos Antonio da Silva

unread,
Aug 25, 2014, 7:09:30 AM8/25/14
to plataformate...@googlegroups.com
You css seems to have an additional . in front of the properties: `.padding-right`, `.font-weight`, that might be the problem maybe?


--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
At.
Carlos Antonio

Melanie M

unread,
Aug 26, 2014, 4:49:48 AM8/26/14
to plataformate...@googlegroups.com
Hey, thanks for trying. No - the dots were just to get the text to render in the post when I created it. It turns out, what worked was to change the name of the div class from 'createproject' to 'create-project'. I have no idea why that was necessary
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simpleform+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
At.
Carlos Antonio
Reply all
Reply to author
Forward
0 new messages