35 posts
  • Affiliate Level 1
  • Author Level 5
  • Beta Tester
  • Collector Level 2
+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.

164 posts
  • 4 Years of Membership
  • Affiliate Level 1
  • Author Level 6
  • Exclusive Author
ThemeProfuse
says

You need to use css shorthand code to improve quality

734 posts
  • Beta Tester
  • 3 Years of Membership
  • Author Level 6
  • Affiliate Level 1
+2 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.

35 posts
  • Affiliate Level 1
  • Author Level 5
  • Beta Tester
  • Collector Level 2
+3 more
TheMetroGuy
says
2065 posts Don't Worry, Be Happy
  • Trendsetter
  • Weekly Top Seller
  • Exclusive Author
  • Elite Author
+9 more
FinalDestiny
says

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

1368 posts
  • Weekly Top Seller
  • 5 Years of Membership
  • Author Level 6
  • Beta Tester
+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

734 posts
  • Beta Tester
  • 3 Years of Membership
  • Author Level 6
  • Affiliate Level 1
+2 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.

1368 posts
  • Weekly Top Seller
  • 5 Years of Membership
  • Author Level 6
  • Beta Tester
+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
  • Author Level 5
  • Collector Level 1
  • 2 Years of Membership
  • Exclusive Author
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)?

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

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

by
by
by
by
by
by