-
Improvement
-
Resolution: Fixed
-
Minor
-
3.7
-
MOODLE_37_STABLE
-
MOODLE_38_STABLE
-
MDL-65438-master -
Core css url's are used to server css files to the end user. In Moodle core they look something like this:
href="http://localhost/stable_master/theme/styles.php/boost/1556192528_1555320661/all"
The styles.php file checks if a URL exists and if the cached version of the css file can be served or if a new css file needs to be generated. For the boost theme this results in recompiling scss to css, caching the new version and serving it back to a client.
This means a theme can only ever generate one CSS file which is identical to all clients.
In a use-case where a smart theme needs to serve a different css file for different pages or context the only option now is to copy the theme to a theme with another name and have the new theme serve a different css file.
This is not very flexible and a lot of work especially when all we need is some different sass variables like the $primary colour that is referenced a lot in bootstrap scss and Moodle core scss files.
The suggested change is just one line, thanks to marina and does not affect existing themes. It has been used on the Moodle for workplace and the Moodle.org themes.