Skip to content

Commit

Permalink
MDL-65438 core_themes: allow themes to change the css url
Browse files Browse the repository at this point in the history
Themes that have the function theme_themename_alter_css_urls() in lib.php
can change the css url from theme/styles.php to a local script like
theme/themename/css.php. The local css.php file can be used to serve
various versions of the theme css, for example versions compiled using
different scss variables.
  • Loading branch information
Bas Brands committed May 8, 2019
1 parent a411b49 commit 66bd0f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/outputlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,8 @@ public function css_urls(moodle_page $page) {
}
}

// Allow themes to change the css url to something like theme/mytheme/mycss.php.
component_callback('theme_' . $this->name, 'alter_css_urls', [&$urls]);
return $urls;
}

Expand Down

0 comments on commit 66bd0f6

Please sign in to comment.