# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/lib/outputlib.php
--- moodle/lib/outputlib.php Base (1.134)
+++ moodle/lib/outputlib.php Locally Modified (Based On 1.134)
@@ -695,13 +695,24 @@
                         and in_array($plugin, $excludes[$type])) {
                         continue;
                     }
+
+                    $plugincontent = '';
                     $sheetfile = "$fulldir/styles.css";
                     if (is_readable($sheetfile)) {
-                        $css['plugins'][$type.'_'.$plugin] = $this->post_process("/*** Standard plugin $type/$plugin ***/\n\n" . file_get_contents($sheetfile));
+                        $plugincontent .= "/*** Standard plugin $type/$plugin ***/\n\n";
+                        $plugincontent .= file_get_contents($sheetfile);
                     }
+                    $sheetthemefile = "$fulldir/styles_{$this->name}.css";
+                    if (is_readable($sheetthemefile)) {
+                        $plugincontent .= "\n/*** Standard plugin $type/$plugin for the {$this->name} theme ***/\n\n";
+                        $plugincontent .= file_get_contents($sheetthemefile);
                 }
+                    if (!empty($plugincontent)) {
+                        $css['plugins'][$type.'_'.$plugin] = $this->post_process($plugincontent);
             }
         }
+            }
+        }
 
         // find out wanted parent sheets
         $excludes = null;
