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 3 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

3696 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 3 years
+1 more
outerbridge says

Thank you Ruben, that’s very helpful.

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

109 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 3 years
+1 more
outerbridge says

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

1509 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
+2 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 3 years
+1 more
outerbridge says

Thanks – I didn’t know about that function.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by