Is there a specific code layout that an item needs to be accepted?

1368 posts
  • Weekly Top Seller
  • 5 Years of Membership
  • Author Level 6
  • Beta Tester
+5 more
Smartik
says

Guys, you really shouldn’t worry about this. Everyone has his coding style, so if you find it easier to write the CSS rules in the same line, do it so, this shouldn’t be a problem at all. Also the buyers can use a CSS beautifier and organize it however they want.

@fitwp, some rules there are just ridiculous. Why shouldn’t I use underscores to define selectors? I like using underscore, because the whole selector is selectable and I will never change this. Seriously.

1149 posts
  • Affiliate Level 1
  • Author Level 3
  • Beta Tester
  • Collector Level 2
+3 more
fillerspace
says

@fitwp, some rules there are just ridiculous. Why shouldn’t I use underscores to define selectors? I like using underscore, because the whole selector is selectable and I will never change this. Seriously.
I prefer dashes for a few reasons:
  • They don’t require the shift key to type
  • They match the style of the CSS specification (:first-child, text-decoration, etc)
  • You can use the |=value operator to match attributes beginning with “value” or “value-”

An interesting bit of trivia, the original CSS spec did not allow underscores: https://developer.mozilla.org/en-US/docs/Underscores_in_class_and_ID_Names

149 posts
  • Author Level 4
  • Collector Level 1
  • Exclusive Author
  • 2 Years of Membership
WPEnter
says

Inline CSS is this (which you shouldn’t do):
<div class="awesome" style="border: 2px solid #FDFDFD; background: #1F1F1F;" />

But it’s fine if you’re entering your style in a stylesheet like this:

.awesome {width: 100%, border: 2px solid #FDFDFD; background: #1F1F1F;}
You won’t be rejected because you’re writing it horizontally instead of vertically. You should consider which is easier for your buyers though for readability.

+1

43 posts
  • Affiliate Level 2
  • Author Level 7
  • Collector Level 2
  • Elite Author
+3 more
fitwp
says


@fitwp, some rules there are just ridiculous. Why shouldn’t I use underscores to define selectors? I like using underscore, because the whole selector is selectable and I will never change this. Seriously.
I prefer dashes for a few reasons:
  • They don’t require the shift key to type
  • They match the style of the CSS specification (:first-child, text-decoration, etc)
  • You can use the |=value operator to match attributes beginning with “value” or “value-”
An interesting bit of trivia, the original CSS spec did not allow underscores: https://developer.mozilla.org/en-US/docs/Underscores_in_class_and_ID_Names

+1, there’re some discussions about this that might help:

http://stackoverflow.com/q/7560813/371240 http://programmers.stackexchange.com/q/141988

By the way, coding standards is not something that forces you to follow. You can have your own style, that’s totally ok. Just keep it consistent, that’s more important.

by
by
by
by
by
by