gjb
gjb

Reputation: 6317

Rails 3: What CSS styles are expected by Rails?

I am creating a custom CSS stylesheet for a Rails 3 application.

Is there a list anywhere of the CSS styles that Rails relies upon? So far I have found:

Many thanks.

Upvotes: 4

Views: 1112

Answers (2)

nathanvda
nathanvda

Reputation: 50057

The css for the flash-messages you can choose yourself, as they are normally defined in application.html.erb (there is no default definition for flash-messages in rails 3).

For form-styling i would recommend using a gem like formtastic, which not only greatly simplifies making forms, but also provides a standard css file. So all needed tags are then known (and can be overwritten if needed).

If on the other hand you are looking at ways to get your complete layout started quickly, you might want to checkout web-app-theme or activo (which is even more complete).

Upvotes: 6

Dylan Markow
Dylan Markow

Reputation: 124419

A fresh Rails 3 app will not require any specific CSS class/id styles beyond the three you just mentioned, which is why no default stylesheet is generated until you start scaffolding.

If you run script/rails generate scaffold MyModel it will create a stylesheet called scaffold.css which the generated views will rely upon.

Upvotes: 1

Related Questions