Skip to content

Instantly share code, notes, and snippets.

@kylemacey
Last active June 28, 2017 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylemacey/08db8dc9dc18bebf4a42 to your computer and use it in GitHub Desktop.
Save kylemacey/08db8dc9dc18bebf4a42 to your computer and use it in GitHub Desktop.
Css diffs
when using single line declaration, and a property is added later
#foo { width: 10px; }
becomes...
- #foo { width: 10px; }
+ #foo {
+ width: 10px;
+ height: 20px;
+ }
Which implies that the selector, #foo may have been changed, and that the value of height may have been touched
#foo {
width: 10px;
}
becomes...
#foo {
width: 10px;
+ height: 20px;
}
here, it's much more clear that only one property was added, making the code review easier to read
@mattcantstop
Copy link

Completely agree fine sir! I am not a fan of single line CSS. It doesn't save much.

@jaw6
Copy link

jaw6 commented Dec 2, 2015

FYI, there are online and command-line tools for formatting CSS. They almost always prefer multi-line.

But a caution: folks will freak out if you suggest comma-first lists, even though it's obviously better. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment