• 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

    • Get used to this, with AI tooling now uncovering new vulns and getting them exploitable far faster than has ever been possible before software is going to need to be updated far more frequently.
    • You don't need to "close all browser sessions constantly" or wait for updates to install. The updates download in the background while you use the browser, without interrupting you, they install automatically the next time you launch the app. And they install very fast (depending on your storage speeds, of course), you have to wait at most 2-3 extra seconds, if any. Seems like you haven't used Edge in a loooooooong time...
    • Segra 1.6.0 by Razvan Serea Segra is a free, open-source OBS-powered game recorder offering fast gameplay capture, instant clips, AI highlights, deep game integration, and seamless uploads—perfect for gamers, streamers, and content creators. Lightweight, fast, zero bloat. Segra key features: Automatic Game Recording: Begin capturing gameplay the moment your game launches, with zero manual setup. Instant Clipping: Save important moments instantly using a customizable hotkey—perfect for highlights, montages, or quick shares. Segra AI Highlights: Let Segra automatically detect kills, assists, deaths, and key events to generate polished highlight reels without manual editing. Gameplay Uploads: Upload recordings and clips directly to Segra.tv for fast sharing and cloud access. Deep Game Integration: Enjoy advanced game-data tracking across hundreds of supported titles, enabling smart highlight generation and stat-informed clipping. High-Performance Capture: Record up to 4K at 144 FPS using OBS-powered technology with minimal performance impact, supporting NVENC, AMD VCE, and custom quality controls. Segra Editor: Edit recordings easily with timeline controls, segment management, and event-based navigation to build the perfect clip. Customization Options: Adjust hotkeys, output formats, storage paths, codecs, capture quality, and performance settings for a tailored recording experience. Segra 1.6.0 changelog: Recording: Added HDR support. Grand Theft Auto: Added game integration for deaths (FiveM and RAGE MP supported). Highlights: Added customizable padding for highlights. Replay Buffer: Added a shockwave visual effect when a replay buffer clip is saved. Audio: Increased the maximum sound effects volume from 100% to 200%. Hotkeys: Fixed hotkeys not triggering while unrelated keys were held. Installer: Added code signing to verify publisher identity, branded the installer, and reduced OS security warnings. OBS: Updated the supported OBS version to 32.1.2. Download: Segra 1.6.0 | 74.4 MB (Open Source) View: Segra Homepage | Github | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • According to the developer(s):    
  • 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
      508
    2. 2
      PsYcHoKiLLa
      176
    3. 3
      +Edouard
      163
    4. 4
      Steven P.
      86
    5. 5
      ATLien_0
      79
  • Tell a friend

    Love Neowin? Tell a friend!