• 0

Dynamic PHP-Driven CSS Stylesheets


Question

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]

Edited by Computer Guru
Link to comment
https://www.neowin.net/forum/topic/507381-dynamic-php-driven-css-stylesheets/
Share on other sites

17 answers to this question

Recommended Posts

  • 0

^ 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.

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 :p

didnt think about the cookie thing though :shiftyninja:

  • 0
' 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: 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.

  • 0

Yes, you can mask it. But if you do, that's your problem. Blocking JavaScript is one thing - there's a legitimate reason to do so. But blocking your UA-Ref is just plain stupid. It exists for a reason, you're being a paranoid doesn't make coders'/designers' jobs any easier.

There are great advantages to PHP-CSS, they may be "common sense" but to date no one is using them... eh? :shifty:

  • 0

Yes, you can mask it. But if you do, that's your problem. Blocking JavaScript is one thing - there's a legitimate reason to do so. But blocking your UA-Ref is just plain stupid. It exists for a reason, you're being a paranoid doesn't make coders'/designers' jobs any easier.

There are great advantages to PHP-CSS, they may be "common sense" but to date no one is using them... eh? :shifty:

maybe because 99% of the time there's ONE stylesheet associated with the entire site? That's the point of CSS isnt it? to centralize all styling. And as the web dev you're not supposed to depend on sniffing useragents to make your site work. It should be able to work regardless of who is claiming to be who but is actually who.

  • 0

^ "should be able to" and "are actually capable of working in today's highly mixed-up online world" are rather different, doncha think ;)

Anyway, like the article states, UA-ref is just one of the many things.

Imagine a neowin where you can click on the header, and change the color, then open your control panel and change the display fonts, or a million other things?

That would be near impossible without dynamic css.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • There is a lot of reasons not to use Edge but faster fixes and security updates is not one of them.
    • Can't reproduce. I installed Edge, went to neowin.net > accepted the cookie consent > used menu to go to forums, everything loads and I can browse around the forums. If you can't interact with the dialog on the forums for some reason, go to the main site and accept the cookie consent there? It is true that the site will not function properly until the cookie consent is accepted or rejected,. it's a legal requirement and I also know that certain VPN/ad blockers block it, which is a user related issue and not a neowin.net problem.   This is not our cookie consent dialog. Gotta love browser hijacking... /s Edit: this may be what Californians see, I will confirm with our consent provider.
    • Google Chrome 149.0.7827.115 (offline installer) by Razvan Serea The web browser is arguably the most important piece of software on your computer. You spend much of your time online inside a browser: when you search, chat, email, shop, bank, read the news, and watch videos online, you often do all this using a browser. Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. Use one box for everything--type in the address bar and get suggestions for both search and Web pages. Thumbnails of your top sites let you access your favorite pages instantly with lightning speed from any new tab. Desktop shortcuts allow you to launch your favorite Web apps straight from your desktop. Chrome has many useful features built in, including automatic full-page translation and access to thousands of apps, extensions, and themes from the Chrome Web Store. Google Chrome is one of the best solutions for Internet browsing giving you high level of security, speed and great features. Important to know! The offline installer links do not include the automatic update feature. Download web installer: Google Chrome Web 32-bit | Google Chrome 64-bit | Freeware Download: Google Chrome Offline Installer 64-bit | Direct Link | 131.0 MB Download: Google Chrome Offline Installer 32-bit | Direct Link | 119.0 MB Download page: Google Chrome Portable Download: Chrome ARM64 | Direct Link View: Chrome Website | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Oh, it's happening on more than one dialog? This is the dialog that I'm unable to interact with.
    • WSCC - Windows System Control Center 10.0.3.8 by Razvan Serea Windows System Control Center is a free, portable program that allows you to install, update, execute and organize the utilities from various system utility suites. WSCC can install and update the supported utilities automatically. Alternatively, WSCC can use the http protocol to download and run the programs. WSCC is portable, installation is not required. Extract the content of the downloaded zip archive to any directory on your computer. Free for personal use. The setup packages and updates are downloaded directly from their author's website! This edition of WSCC supports the following utility suites: Windows Sysinternals Suite (including support for "Sysinternals Live" service) NirSoft Utilities Mitec and more... WSCC - Windows System Control Center 10.0.3.8 changelog: [NEW] update progress is now visible on the Windows taskbar [FIXED] fixed an issue with the Update dialog [FIXED] minor fixes Download: WSCC (64-bit) | 5.4 MB (Free for personal use) Download: WSCC (32-bit) | 6.3 MB View: WSCC Homepage | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      Clizby earned a badge
      One Month Later
    • One Month Later
      Timaximus earned a badge
      One Month Later
    • Week One Done
      Timaximus earned a badge
      Week One Done
    • Rookie
      FBSPL went up a rank
      Rookie
    • First Post
      davidbazooked earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      492
    2. 2
      PsYcHoKiLLa
      170
    3. 3
      +Edouard
      164
    4. 4
      Steven P.
      85
    5. 5
      ATLien_0
      77
  • Tell a friend

    Love Neowin? Tell a friend!