register_hook('ACTION_HEADERS_SEND', 'BEFORE', $this, 'handleCssForDoAction'); } /** * @param Doku_Event $event */ public function handleCssForDoAction(Doku_Event &$event) { if (!Site::isStrapTemplate()) { return; } global $ACT; switch ($ACT) { case "media": PluginUtility::getSnippetManager()->attachCssInternalStylesheet("do-media"); break; case "edit": case "preview": PluginUtility::getSnippetManager()->attachCssInternalStylesheet("do-edit"); break; case "admin": $defaultColor = "black"; $config = ExecutionContext::getActualOrCreateFromEnv()->getConfig(); $iconColor = $config->getPrimaryColorOrDefault($defaultColor); $colorText = ColorSystem::toTextColor($iconColor); $css = <<toRgbHex()}; } .icon svg { color: {$iconColor->toRgbHex()}; fill: {$iconColor->toRgbHex()}; } EOF; PluginUtility::getSnippetManager()->attachCssInternalStylesheet("do-admin", $css); break; } } }