lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
CSS: Stylesheet Constants using PHP
Probably fancier than I need, but I like the idea of defining constants for commonly used color settings. Example:

// source: http://perhapstga.blogspot.com/2001/01/favourite-colours.html

define('CLR_PARCHMENT', '#f3f1eb');
define('CLR_COFFEE_STAIN', '#b5ad95');
define('CLR_PARCHMENT_BLUE', '#6F7DA2');


Then I would just use something like this for internal or inline stylesheets:

.style1
{
color: <?php echo CLR_PARCHMENT; ?>;
}


But, this is a much more versatile method for using external style sheets.

keywords: css, php, colors