I am writing a Joomla module that includes a custom CSS stylesheet:
$document->addStyleSheet("modules/mod_custommenu/css/custommenu.css");
Now, this module needs to allow for customization of several CSS properties. I could include CSS inline in the module template, but I'd rather reference a separate file. I would like to:
- Reference a separate CSS object (via URL)
- Generate that CSS file using Joomla templates, like:
.custommenu_<?php echo $module->id; ?> .menutitle {
color: <?php echo $params->get('titlecolor'); ?>;
}
- If possible, cache the rendered CSS file so Joomla doesn't need to generate it everytime it is accessed.
How can I do this? Or what is the correct approach for generating ad-hoc module CSS files?