 <p>Usually, I use this technique:</p> <p>1) each template generates specific class in the body or some enveloping DIV</p> <pre><code> &lt;body class="myTemplate"&gt;... &lt;body class="otherTemplate"&gt;... </code></pre> <p>2) I specify general style, like</p> <pre><code>h1 { color: red; } </code></pre> <p>3) then I specify special styles for specific templates, using context selectors:</p> <pre><code>.myTemplate h1 { color: green; } .otherTemplate h1 { color: blue; } </code></pre> <p>This way I avoid dynamic stylesheets, because that is usually a bad idea to introduce these to the project. It is a source of many errors and duynamic code tends to grow beyond controll.</p>