5

I am having trouble refactoring from CSS to LESS.

In the past I put up with swathes of CSS spaghetti since CSS is pretty awful in terms of features for organisation. (Hence why LESS was invented).

But while LESS has more than enough extensions of CSS to facilitate good code structure, I am struggling to refactor the messy CSS into non-messy LESS.

Where could I ask about rule-of-thumb techniques or similar for splitting up LESS into sensible chunks, perhaps akin to OOP encapsulation and other OOP heuristics?

For example, some ideas which I have played with but not been very successful with, separating these from other aspects, putting each one in its own LESS file

  • Separate the "theme" (E.g. colour scheme)
  • Separate the "layout" - e.g. box/container/element sizes
  • Separate the interactive elements (e.g. styling of links, buttons, form elements)

Or perhaps I can rephrase the question without losing the sort of answers I'm looking for, so that it fits into SO guidelines?

2
  • Not appropriate for Stack Overflow, not in the proposed form. Could work on Code Review, but only in regards to specific pieces of CSS, not in general. See Code Review On-topic. Actually, I'm not sure. Wait for more opinions.
    – user456814
    May 14, 2014 at 9:32
  • 2
    @Cupcake I'm thinking this might be one for Software Engineering - it's about the technical part of website architecture/design. It might be considered "primarily opinion-based" though. May 14, 2014 at 9:36

0

You must log in to answer this question.

Browse other questions tagged .