116 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 and 100 dollars
  • United States
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?

1031 posts
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • France
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Contributed a Tutorial to a Tuts+ Site
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
Pixelworkshop says

hehe can we make a style switcher from that ?

659 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 10 000 and 50 000 dollars
  • United States
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
  • United States
  • Attended a Community Meetup
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Has been a member for 5-6 years
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
+4 more
CreatingDrew says
922 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Most Wanted Bounty Winner
  • Bought between 500 and 999 items
  • Referred between 500 and 999 users
  • Interviewed on the Envato Notes blog
  • Envato Studio (Microlancer) Beta Tester
  • Won a Competition
+8 more
MDNW says

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

1733 posts
  • Exclusive Author
  • Won a Competition
  • Sold between 5 000 and 10 000 dollars
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Bought between 1 and 9 items
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
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Belgium
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
Hy-Studio says

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

659 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 10 000 and 50 000 dollars
  • United States
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
  • Sold between 10 000 and 50 000 dollars
  • United Kingdom
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Bought between 1 and 9 items
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.

by
by
by
by
by
by