Reply to this topic Topic Options
2 Pages V   [1] 2 ... Next
Dynamic PHP-Driven CSS Stylesheets, What would you do with them?
Computer Guru
Post #1 Oct 28 2006, 21:50


Mostly Harmless...
Group Icon

Group: Registered
Posts: 2,258
Joined: 23-April 05
From: The Great Middle East
Member No.: 107,016
Can you imagine running a website with hundreds of pages off pure, static, html? Without a single bit of server-side code? No PHP, Perl, Ruby, or even SHTML? What about a site with hundreds of thousands of pages? or millions? Of course not. So why do you put up with static CSS files then?!

This article takes a look at the unused potential of dynamic CSS sheets and how they help.
Case Study: Shaun Inman's site with 33,306 CSS Sheets in use.

Other benefits:
Completely overhauled user experience
Faster sites
CSS-Contained browser detection


That's just some of the stuff you can do with something like that.

Article: Dynamic (PHP-Driven) CSS Stylesheets
Source: NeoSmart Technologies

[digg]

This post has been edited by Computer Guru: Oct 28 2006, 22:00
Profile Card PM + Reply to Post Go to the top of the page

Log In or Register · Advertise on Neowin
guylaroche
Post #2 Oct 28 2006, 21:52


BlackBerry Fanatic
Group Icon

Group: Registered
Posts: 2,989
Joined: 9-April 06
From: Waterloo Region, ON
Member No.: 162,889
Wow. Now that is impressive. ohmy.gif
Profile Card PM + Reply to Post Go to the top of the page Email Poster
Computer Guru
Post #3 Oct 28 2006, 21:55


Mostly Harmless...
Group Icon

Group: Registered
Posts: 2,258
Joined: 23-April 05
From: The Great Middle East
Member No.: 107,016
Thanks! biggrin.gif
Profile Card PM + Reply to Post Go to the top of the page
Colicab
Post #4 Oct 28 2006, 21:55


HPI Firestorm
Group Icon

Group: Registered
Posts: 2,378
Joined: 25-May 03
From: Glasgow Scotland
Member No.: 29,122
Bookmarked!! Gonna have a proper read over this tomoz before implementing some of its ideas smile.gif
Profile Card PM + Reply to Post Go to the top of the page Email Poster
Colin-uk
Post #5 Oct 28 2006, 22:09


Neowinian Super Cool
Group Icon
Group Icon

Group: Supervisor
Posts: 18,488
Joined: 25-February 04
From: Wirral, UK
Member No.: 48,788
its a nice idea, but having a different stylesheet everyday could be confusing..
Profile Card PM + Reply to Post Go to the top of the page
Computer Guru
Post #6 Oct 28 2006, 22:14


Mostly Harmless...
Group Icon

Group: Registered
Posts: 2,258
Joined: 23-April 05
From: The Great Middle East
Member No.: 107,016
^ Did you RTFA?
Because that's the point of the article - you no longer need to do that. With dynamic CSS it does it automatically for you.
Profile Card PM + Reply to Post Go to the top of the page
jtchange
Post #7 Oct 28 2006, 22:41


Hello, I'm Jeremy
Group Icon

Group: Registered
Posts: 893
Joined: 7-August 04
From: Michigan
Member No.: 65,570
it's nice for having different themes for your site. you can set a cookie and PHP will handle the rest based on the cookie
Profile Card PM + Reply to Post Go to the top of the page Email Poster
Joshua-San
Post #8 Oct 28 2006, 22:55


NeowinianČ
Group Icon

Group: Registered
Posts: 211
Joined: 26-March 05
Member No.: 102,805
Very handy! Of course, why didn't I think of this before? This is probably the perfect solution for those ugly CSS hacks for IE!
Profile Card PM + Reply to Post Go to the top of the page
Computer Guru
Post #9 Oct 28 2006, 22:58


Mostly Harmless...
Group Icon

Group: Registered
Posts: 2,258
Joined: 23-April 05
From: The Great Middle East
Member No.: 107,016
It's just one of those things that are so obvious that no one thinks of them no matter how useful it might be IMO.
Profile Card PM + Reply to Post Go to the top of the page
Colin-uk
Post #10 Oct 28 2006, 23:00


Neowinian Super Cool
Group Icon
Group Icon

Group: Supervisor
Posts: 18,488
Joined: 25-February 04
From: Wirral, UK
Member No.: 48,788
Quote - (Computer Guru @ Oct 28 2006, 23:14) [snapback]587996306[/snapback]

^ Did you RTFA?
Because that's the point of the article - you no longer need to do that. With dynamic CSS it does it automatically for you.



Quote - (jtchange @ Oct 28 2006, 23:41) [snapback]587996373[/snapback]

it's nice for having different themes for your site. you can set a cookie and PHP will handle the rest based on the cookie


Thats what i meant tongue.gif

didnt think about the cookie thing though shiftyninja.gif
Profile Card PM + Reply to Post Go to the top of the page
[idkfa]
Post #11 Oct 28 2006, 23:15


Resident Elite
Group Icon

Group: Registered
Posts: 1,407
Joined: 20-November 01
Member No.: 3,893
I've done this before, so here's a handy tip: give your PHP'ed CSS file a .css extension and set PHP to interpret it via a .htaccess file. Now your techniques are a bit more covered plus it might avoid problems with older problems.
Profile Card PM + Reply to Post Go to the top of the page Email Poster
Computer Guru
Post #12 Oct 28 2006, 23:18


Mostly Harmless...
Group Icon

Group: Registered
Posts: 2,258
Joined: 23-April 05
From: The Great Middle East
Member No.: 107,016
Quote -
' date='Oct 29 2006, 01:15' post='587996470']
Now your techniques are a bit more covered plus it might avoid problems with older problems.


blink.gif Come again?

....

Also, if you use the header() line mentioned in the article there is no need for css extension - it's just another MIME - esp. since only Apache has .htaccess.
Profile Card PM + Reply to Post Go to the top of the page
Trix.Neo
Post #13 Oct 29 2006, 00:04


URBANWARFARE / NE14HOCKEY / HOWZ-TRIX
Group Icon

Group: Registered
Posts: 1,567
Joined: 1-August 05
From: United Kingdom, Peterborough
Member No.: 121,351
Very neat idea biggrin.gif
Profile Card PM + Reply to Post Go to the top of the page
Code.Red
Post #14 Oct 29 2006, 01:38


Neowinian Senior
Group Icon

Group: Registered
Posts: 2,974
Joined: 2-August 04
From: SoCal, USA
Member No.: 64,824
Nice, never even thought of that. Oh, and I hope that guy that had 33,306 styles had those files automatically generated. pinch.gif
Profile Card PM + Reply to Post Go to the top of the page Email Poster
primexx
Post #15 Oct 29 2006, 05:28


Neowinian DOMINATING
Group Icon

Group: Registered
Posts: 9,420
Joined: 24-April 05
Member No.: 107,134
The part about serving useragent specific stylesheets, that is FLAWED! People can mask their UA so you DO NOT KNOW what browser it is using PHP. Stay with IF IE conditional comments for the hacks. Otherwise, the article is just rephrasing common sense.
Profile Card PM + Reply to Post Go to the top of the page
« Older · Web Client Side · Newer »
2 Pages V   [1] 2 ... Next  Reply to this topic