Monday, August 22, 2011

Css, page design and Rails applications

I think a lot about function and form when I'm coding. I hate looking at the default black text on white body when working on an application, so I usually do some basic styling early in development. I definitely tend to get bogged down with CSS, spending entirely too much time adjusting margins, padding and other granular details, but I don't think styling can be entirely separated from the function of an application.

For example, I created a basic navigation partial, wrapped it in a div and styled it to appear at the top of all the pages in my Manticore app. I'm not sure how this will change in the final version, or if I'll keep it at all, but it certainly helps out right now, when I want to quickly switch back and forth to test navigation or to see how a change in the code works. Or if it works at all!

How do you work with styling when developing a new application? Do you leave it until the end, or do you do some basic styling and then polish it up later? Do you have someone else do it? I know it doesn't make sense to style something that may not be included in the final version of an application, but I'm not sure how other developers work when it comes to basic styling.

Agile Web Development with Rails did styling early on in the development, with some minor tweaks here and there later. It was coming from the perspective of working for a client who wanted an e-commerce site created, so that may have had something to do with getting page styles hammered out early.


  1. I think its good to come up with a good default layout and styling early on for all the types of pages and forms you can. Once that is done, you should really rarely need to mess with styles at all.

  2. It depends on the situation, but it's often nice to have some sort of template going early, even if it's not at all like what the final version will look like, just so that you're not dealing with plain browser-default styles. However, sometimes you just don't want, or don't have the time, to mess with CSS. So, you just bang away on functionality. For instance, if you know a client is getting you the styles, but they're running a bit late, and you need to get thing moving along regardless, it can be counter-productive to mess with the CSS.

  3. Awesome, thanks for the tips! Eli told me Fastest Forward has a template they use for many projects, even if the final design changes significantly. Seems like that might save some time as well, if there are some style elements you use often.

  4. You should check out a rails gem called 'web-app-theme', its pretty comprehensive for a "I didn't do any custom styling, but I don't want this to look horrible" solution.

  5. @David thanks, I'll check it out. I'm assuming it just provides a basic clean looking template, right? I'll still want to tweak styling of my applications, but if it gets me even 25% of the way, it'd be a big time saver.