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

4 posts
  • 2 Years of Membership
  • Collector Level 1
  • Exclusive Author
  • United Kingdom
studiowebmedia
says

Hello Guys!

First post here, so go easy ;)

I am a couple of weeks away from my submission, really looking forward to getting myself on the marketplace!

I was just wondering, is there any particular way themeforest requires code, more specifically CSS to be laid out?

The reason I ask, is that in my css, i find it easier to work and write, in one line, per selector. (below eg.)

.awesome {width: 100%, border: 2px solid #FDFDFD; background: #1F1F1F;}

Does my code have to be formatted to the following to be approved?

.awesome {
width: 100%;
border: 2px solid #FDFDFD;
background: #1F1F1F;
}

Don’t want to miss out, by such a small thing.

Cheers guys!

196 posts
  • Affiliate Level 3
  • Author Level 8
  • Collector Level 1
  • Elite Author
+4 more
phpface
says

I think you can write the code as your way in css file, don’t put it in html/php template.

4 posts
  • 2 Years of Membership
  • Collector Level 1
  • Exclusive Author
  • United Kingdom
studiowebmedia
says

Hi phpface!

So no inline css at all?

Thanks :)

196 posts
  • Affiliate Level 3
  • Author Level 8
  • Collector Level 1
  • Elite Author
+4 more
phpface
says

yes, the reviewer will not approve your item, if it have the inline or internal css, thats the item rules :)

4 posts
  • 2 Years of Membership
  • Collector Level 1
  • Exclusive Author
  • United Kingdom
studiowebmedia
says

Excellent! Great help! Thanks again.

188 posts Keep Calm and GPL On
  • Elite Author
  • Winner
  • Author Level 7
  • Envato Live Participant
+7 more
RescueThemes
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.

4 posts
  • 2 Years of Membership
  • Collector Level 1
  • Exclusive Author
  • United Kingdom
studiowebmedia
says

Thanks RescueThemes,

I know it sounds silly, but I just thought that some people may find it hard to read, is they’re not used to seeing CSS laid out like that :p

Better to be safe than sorry I say,

Thanks :)

232 posts
  • 5 Years of Membership
  • Author Level 6
  • Affiliate Level 1
  • Collector Level 1
+1 more
MsTrends
says

Thanks RescueThemes,

I know it sounds silly, but I just thought that some people may find it hard to read, is they’re not used to seeing CSS laid out like that :p

Better to be safe than sorry I say,

Thanks :)

If there are numerous properties in CSS selector its better to write all those vertically, for better readability. However, if there are a few, you can write it horizontally. (just try to make sure customer doesn’t have to scroll horizontally for each selector)

415 posts
  • Elite Author
  • Trendsetter
  • Author Level 7
  • Exclusive Author
+4 more
BigBangThemes
says

Guys the reviewers are not some scary monsters. There are some rules regarding code writing but only stuff that’s extremely intuitive. If you write css code in your style.css file without proper breaks the code is impossible to read and edit by others, that’s why it needs proper indentation. Same goes for all other code written.

Otherwise, make sure the HTML passes the w3c validator and that you’re properly commenting your code. That’s about it for HTML.

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

If you’re making WordPress theme, you should follow this guide:

http://make.wordpress.org/core/handbook/coding-standards/css/
by
by
by
by
by
by