116 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $1+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
finsta2 says

Here is an idea I thought would be useful for Themeforest Authors.
So when coding your template why not use a simple trick to make it easier for you?

Here is my sample stylesheet:
<?php header('content-type:text/css');
header("Expires: ".gmdate("D, d M Y H:i:s", (time()+900)) . " GMT"); 
/* Company Colours */ 
$blue='#ccc';
$green='#363';
$lgreen='#cfc';
?>

body {
    background: <?php echo $green; ?>;
}

div {
    width:500px;
    height:250px;
    background: <?php echo $blue ?>;
}

Now before you start screaming all the possible problems like browser cache, over processing the server and etc.

Here is the beauty of it just use the generated css. It is an idea & I think it will speed production.

What do you think?

1043 posts
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
+9 more
Pixelworkshop says

hehe can we make a style switcher from that ?

659 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
luckykind says

I’ve been using dynamic CSS with PHP for years… I’m not sure whether it speeds production or not… but I agree it is a useful way to make a style switcher… :)

2541 posts
  • Has referred 10+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Located in United States
+9 more
CreatingDrew says
922 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Won a competition
  • Made it to the Authors' Hall of Fame
+13 more
MDNW says

How to speed up your coding: Take ritalin Drink more coffee.

1744 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
VisualSharing says

There are also other tools to speed up coding like using a text expander or using zen coding. I already use zen and it’s fast+fun. :)

And if we talk about dynamic CSS , php is good but not designed for the purpose, while Compass is, as far as I know.

715 posts
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Belgium
+1 more
Hy-Studio says

Can we use this for Site Templates if we make a good documentation explaining this?

659 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
luckykind says
Can we use this for Site Templates if we make a good documentation explaining this?

I’ve got it in one of mine… I don’t see why not… it’s going to have to include a PHP file and anybody purchasing it would have to know a little PHP … but that’s pretty much the same that goes for all the Wordpress files sold here….

31 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Located in United Kingdom
+2 more
JollyGoodThemes says

I normally have a main stylesheet and seperate stylesheets for each of the colour variations and then just echo in the stylesheet the user has selected. Less work for me and the server.

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