31 posts
    Has referred 1+ members Has sold $10,000+ on Envato Market Has been a beta tester for an Envato feature Has collected 10+ items on Envato Market
+3 more
TheMetroGuy says

Hi all,

My WordPress theme was soft rejected saying the CSS need improvements and there are some bad practices.

I fixed a few but want to clean it as much as possible before submitting again.

Are there any articles discussing about bad practices, things to avoid?

I already googled and found few. I’m asking in the forums for some expert opinion.

Thanks in advance, Chaitanya.

159 posts
    Has been part of the Envato Community for over 3 years Has referred 1+ members Has sold $40,000+ on Envato Market Sells items exclusively on Envato Market
+1 more
ThemeProfuse says

You need to use css shorthand code to improve quality

356 posts
    Has been part of the Envato Community for over 2 years Has referred 1+ members Has sold $40,000+ on Envato Market Sells items exclusively on Envato Market
+1 more
billyf says

Well, without any ‘preview’ of what you currently have in your codes, it would be a bit difficult to tell you exactly what ‘bad practices’ you have in your codes.

31 posts
    Has referred 1+ members Has sold $10,000+ on Envato Market Has been a beta tester for an Envato feature Has collected 10+ items on Envato Market
+3 more
TheMetroGuy says
1748 posts Don't Worry, Be Happy
    Has referred 200+ members Has sold $250,000+ on Envato Market Has been a beta tester for an Envato feature Has collected 10+ items on Envato Market
+8 more
FinalDestiny says

validate your code through the w3c validator http://jigsaw.w3.org/css-validator

1113 posts
    Has referred 50+ members Has sold $40,000+ on Envato Market Has been a beta tester for an Envato feature Has collected 50+ items on Envato Market
+5 more
Smartik says

validate your code through the w3c validator http://jigsaw.w3.org/css-validator

0 errors: Link

There are some warnings which can be ignored, like: moz, webkit

356 posts
    Has been part of the Envato Community for over 2 years Has referred 1+ members Has sold $40,000+ on Envato Market Sells items exclusively on Envato Market
+1 more
billyf says

Well, I wonder what’s the purpose of all the commented styles? For instance :

width:100%; /*height:250px; */ margin:20px 0px;
Also, why is there a heavy mix of different coding styles, such as some with :
ul#portfolio, ul#portfolio-nav{list-style: none; margin-left:0px;}
But others are coded using this style :
.team ul li.last-in-row div.block{
    margin-right:0px;
}

The latter is the preferred style as it makes code modification easier due to increased legibility.

1113 posts
    Has referred 50+ members Has sold $40,000+ on Envato Market Has been a beta tester for an Envato feature Has collected 50+ items on Envato Market
+5 more
Smartik says

@TheMetroGuy, separate styles in more .css files. I see that you have media queries in the same .css file which of course is a bad practice. Responsive design should be optional.

161 posts
    Has sold $10,000+ on Envato Market Has collected 1+ items on Envato Market Located in Europe Has been part of the Envato Community for over 1 year
+1 more
themebros says

Why do you have all selectors start in the same vertical line?

.selector
.child
.child-of-child

It’s not very readable. Do it like:

.selector
    .child
        .child-of-child

Check out the CSS Coding Standards – by the WP team

Which CSS file is your main CSS file (the one with the theme info at the top)?

1113 posts
    Has referred 50+ members Has sold $40,000+ on Envato Market Has been a beta tester for an Envato feature Has collected 50+ items on Envato Market
+5 more
Smartik says

^ themebros, NO. This is not a reason to get rejected.

by
by
by
by
by
by