Use a template as you would do to build a sitemap for example.
So would have something like this:
// I'm adding this to main page controller so it's accessible to all pages, feel free to change this
Page_Controller extends ContentController{
// Create the action and make it visible to the browser
private static $allowed_actions = array( 'mycss' );
private static $visible_actions = array( 'mycss' );
// Handle the action and make sure to add the css header
public function mycss(){
$this->response->addHeader( 'Content-type', 'text/css' );
return $this->renderWith( 'mycsstemplate' );
}
}
then under themes/mythemename/templates place:
mycsstemplate.ss which would contain something like:
.background{ background: '#{$myVar}'; margin: 0; padding: 0; ... }
finally in your Page.ss template or whever you're using this in the head section add:
<link rel="stylesheet" href="{$Link}mycss" type="text/css" />
Posted to: Theme build within the admin to alter css in themes | Show Thread | Post Reply