Dynamic cascading style sheets

Cascading Style Sheets

* Style sheet
* CSS Zen Garden
* The Zen of CSS Design

Concepts

* box model
* image replacement
* flexbox
* grid

Philosophies

* Tableless
* Responsive
* "Holy grail"

Tools

* Sass
* Less
* Stylus
* CSSTidy

Comparisons

* CSS support
* Stylesheet languages

* Cascading Style Sheets

* v
* t
* e

Dynamic CSS, or DCSS, is an umbrella term for a collection of technologies used together to create dynamic style sheets, by using a combination of any server-sided programming language (such as PHP/ASP/Perl/JSP) and Cascading Style Sheets (CSS). The first idea of DCSS was written in July 2002 by Jori Koolstra, a Dutch programmer.[1]

DCSS allows you to work with variables in CSS and dynamic rewriting of CSS source. Many content management systems have created additional modules, for example Drupal.[2] Sass and Less can be used as dynamic stylesheet languages.

## Contents

* 1 Example with PHP
* 2 See also
* 3 References
* 4 External links

## Example with PHP

Typically a web page using DCSS is set up in three files. A file that holds the CSS variables, a .php file that echos the CSS content and the web page where the CSS is needed.

A .dcss file normally looks like this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>DCSS example</title>

<style type="text/css">
<?php
/* Include the style sheet */
require_once("sheet.dcss.php");

</style>

</head>
<body>
</body>
</html>

The included .dcss.php file. Notice that a dcss file always has a .php extension.

<?php

/* Include the variables file */
require_once("vars.php");

echo "p";
echo "{";
echo "font-family:    \"$FONT_TYPE\";";
echo "}";

And the file that holds the variables for the dcss.php file (often called vars.php).

<?php

$FONT_TYPE = "Courier New";

## See also

* Dynamic web page
* Dynamic HTML

## References

1. ↑ Koolstra, Jori (2 July 2002). "Dynamic CSS". Archived from the original on 19 August 2010. https://web.archive.org/web/20100819062059/http://www.jori-koolstra.nl/DCSS/dcss.txt. Retrieved 18 July 2010.
2. ↑ ceardach (3 March 2010). "Dynamic CSS". Drupal. http://drupal.org/project/dcss. Retrieved 27 January 2011.

## External links

* Codewalkers.com - Dynamic CSS with PHP tutorial

* v
* t
* e

Style sheet languages

Modes|

* Desktop publishing
* Web development
* User interfaces

Standard|

* Cascading (CSS)
* DSSSL
* Extensible (XSL)

Preprocessor|

* JavaScript (JSSS)
* FOSI
* Qt
* Sass
* Less
* Stylus
* SMIL Timesheets
* PostCSS

* List
* Comparison

0.00

(0 votes)

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Dynamic_cascading_style_sheets&oldid=220469"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template