4 posts
  • Located in United Kingdom
  • Has sold $5,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 2 years
+1 more
outerbridge says

Hi

I’m working on my first TF theme and am trying to make the technical improvements required to get it approved.

One of the things that I’ve been doing is including an @import after the style information and before standard formatting. E.g.:

@import 'includes/style.php';

The style.php puts in the various headers like “Content-Type: text/css” and allows me to set different skin options dynamically.

But I wondered if this is the best way of switching theme skins and whether it’s okay for themes submitted to ThemeForest?

Many thanks

3567 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

I’ve learned that the best thing to do in terms of security, file permissions, speed, is to write custom css directly into the header of the theme.. So if you don’t have a lot of options(just some colors and fonts), output custom css options directly into the theme header.

If you’re using a php file you might have speed/server issues(as some fellow authors experienced)..

If you’re using a css file and wanna write it with php, you’ll have 1 support ticket a day regarding the file not working(permissions problems)..

If you’re embedding small chunks of code into the header you’ll have none of this. If however you’re using custom skins, such as(dark, light) for example, and these have a lot of code lines inside them, you might be fine with making two separate stylesheets and activate one or the other..

4 posts
  • Located in United Kingdom
  • Has sold $5,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 2 years
+1 more
outerbridge says

Thank you Ruben, that’s very helpful.

Is this something that would have caused my theme to be rejected?

108 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+4 more
designedbydash says

Thank you Ruben, that’s very helpful. Is this something that would have caused my theme to be rejected?

I doubt it, however I agree with Ruben that inline CSS in the header is the way to go. It’s not as “clean” but it’s certainly more reliable.

4 posts
  • Located in United Kingdom
  • Has sold $5,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 2 years
+1 more
outerbridge says

That’s good to know. Many thanks for your help.

1484 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

You should also check out this function: wp_add_inline_style

4 posts
  • Located in United Kingdom
  • Has sold $5,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 2 years
+1 more
outerbridge says

Thanks – I didn’t know about that function.

by
by
by
by
by
by