Magento 1.9 – Is There a Responsive Grid System in the New RWD Theme?

ce-1.9.0.1magento-1.9rwdrwd-theme

Is there a responsive grid system in Magento's new 1.9 RWD theme?

If this new theme is not using a grid system how is the theme responsive?

I've looked through the CSS & SCSS & I can't find one?

Best Answer

No, there is not a responsive grid system in the new CE 1.9/EE 1.14 RWD theme unfortunately. Grid systems create a number of reusable classes often named using numbers for the amount of columns available, for example in a 12 column grid a grid system will often use something like .col1, .col2, .... .col12 each corresponding to a fixed (px) or fluid (%) width. It then adds media queries to tell those numbered columns when to become full width of the screen a.k.a when to "stack" vertically.

The RWD theme instead takes what I would call an "as needed" approach meaning when an element needs to change its width based on screen size it is listed out individually in the CSS.

For example in styles.css:

@media only screen and (max-width: 770px) {
  .col2-set .buttons-set .button,
  .col2-set .buttons-set .button2 {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

While there is debate about using a grid system for the entire layout of a Magento site if you are building a new responsive theme based on RWD you most likely will benefit from a grid system if your design will use a number of CMS pages.

You can use any grid system out there but I would recommend going with the smallest and simplest solution possible. One option is: http://www.responsivegridsystem.com/calculator/

Choose the number of columns you want (12 is most likely the popular choice) and your margin. The calculator will produce the CSS you need for a small light weight grid system. This one uses 480px as its only break point but you can easily customize this in the CSS and add additional break points as your design requires.

You can choose to place this in your own CSS file (and then load it only on the pages you require it on) or add it to an existing CSS file depending on your organizational preferences.

Related Topic