| CSS Constants Moving server side |
There are basically two ways to simulate CSS constants on the server. One involves using the server software and the other involves using scripting languages on the server.
Using Server Side Includes (SSI)
Server Software, like Apache and the Microsoft IIS allow for server side includes (SSI). We can use these to simulate CSS constants.
For Apache, we define a new file extension called “sccs” for “Server Cascading Stylesheets” by adding the following to the configuration file of the server:
AddHandler server-parsed .scss
Inside one of these new “scss” files we can use the Server Side Includes syntax to set and retrieve our constants:
<!--#set var="blue" value="#369" -->
<!--#set var="green" value="#363" -->
background:
<!--#echo var="blue" -->;
border-bottom:1px solid
<!--#echo var="green" -->;
Many Web space providers won’t allow users to change the server configuration, though. What most provide are Server Side Scripting Languages, that can also be used to simulate CSS constants. |
| Return to Listing |