Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are "CSS Shorthands" not good in team development?

Tags:

css

Are "CSS Shorthand" not good in team development?

When multiple person work on same project . any person can have different level knowledge of CSS so some people can be confused with shorthand when they need any changes in css.

For example:

Should i avoid this

font: 1em/1.5em bold italic serif

and use this

font-size: 1em;
line-height: 1.5em;
font-weight: bold;
font-style: italic;
font-family: serif 

in team development? and Which shorthands are other CSS shorthand are not good to use for readability and which are good?

like image 300
Jitendra Vyas Avatar asked Mar 05 '10 03:03

Jitendra Vyas


2 Answers

When "writing code", i tend to be fairly verbose. When code such as css/js are pushed to production they can easily be minimized/optimized automatically by a delivery script, giving you the best of both worlds.

like image 136
Ben Rowe Avatar answered Sep 19 '22 09:09

Ben Rowe


While evidently unpopular on SO, a couple points in favor of breaking things onto multiple lines in team scenarios:

1) Clarity when using source control. Individual lines changing in source control are often easier to deal with and very clear when reviewing changelogs.

2) With tools like firebug, etc. having the correlation to exact line numbers can be helpful when you are tweaking properties, hunting, saving, reloading vs. one property of many in one line.

like image 40
Mike Duncan Avatar answered Sep 20 '22 09:09

Mike Duncan