css - Code reuse with LESS -
so, i'm in project. have running application same clients have. thing changes, little bit of (pure) css. big problem, each page, have css stylesheet, , each client, have same sheet, specific changes made.
i'm thinking on way reduce redundant code, , starting use css precompiler @ same time, ease our development process, less. have ground rules, are:
- code refactoring bad idea, it's many code , not worth it
- the final css filesize cannot bigger, our sites have heavy traffic
my first idea, write precompiler enables "extending" sheets, extending view, blocks , stuff (like this), , write little script diffs files , automatically extends it, , creates file differences only, this:
/** @extends: site/home/test */ #square-test { background: #c00; }
but seems complicated, , little bit messy. has been same situation? how did guys handle it? has ideas?
i'm thankful help.
edit:
i'm using regular lamp, php 5.3.newer.
you can use sass extend or import stylesheet , can create settings sass document has variables such colors, buttons styles, or whatever variations need.
@import "settings"; //site specific settings @import "allsites"; //styles sites //any site specific rules here
http://sass-lang.com/docs/yardoc/file.sass_reference.html#import
this way front-end frameworks work. have rules work settings adjustable.
Comments
Post a Comment