0

I am currently working on a large scale project with mutiple frontend and backend devs. It is basically a large e-commerce solution with different brands in mind that have the same core structure but different styles and layouts.

My question is this:

Is there a css style guide for large existing projects? Or how could we refactor code optimally without loosing logic and breaking stuff?

The styles are chaotic and in need for desperate re-factoring. We got part of the project from our client and we were kinda forced to style and work on those existing layouts and styles.

In some parts we have 10 generations of selectors and often we need to supply !important rules just to get the job done.

I`m sorry I cannot give you code or a sample because of legal obligations.

AlexForm
  • 77
  • 2
  • 7
  • It's going to be a manual re-factoring process, there's no way to automate this - yes it's probably going to be quite time consuming. Adding `!important` everywhere seems like a bad way to go. – Nick R Jul 10 '13 at 10:31
  • 1
    I`m not looking for a automation process, that would be catastrophic. I`m more looking for rules of engagement that I can share with my team so we can begin refactoring code. But nontheless !important is the devil I know. – AlexForm Jul 10 '13 at 11:01

1 Answers1

0

Nowadays CSS becoming more powerful than JavaScript.With help of Media Query u can specify conditions thus breaking up your Css Structure.Also there are lots of directive tags starting with '@', which are more powerful .Go through those tags.You will get better support only in CSS 3 and not in CSS 2.1

Madhavan NR
  • 178
  • 1
  • 1
  • 13
  • 1
    I will dig into that, it seems a viable solution. Thanks – AlexForm Jul 10 '13 at 11:03
  • @Madhavan NR can you share some links or examples ? – Ali Umair Jul 22 '13 at 11:33
  • Go thro these links just for intro https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries http://css-tricks.com/css-media-queries/ And just see this link to understand the power of media query
    http://mediaqueri.es/
    – Madhavan NR Jul 22 '13 at 12:07