Posts made by David Scotson

Hi Brian,

you can achieve your "ideal choice" as long as you add

$THEME->parent_exclude_sheets = array('moodle');

to the child theme's config.php.

As Richard notes, updates to the less files in Bootstrapbase will not be picked up automatically in this case, you'd need to recompile if those files changed. I personally would try to automate such stuff to happen automatically on upgrades, but that's not possible for everyone. I did survey such changes historically and there didn't seem to be that many, but having said that there's been a bit more activity around themes lately.

Your option 1 and 3 would give you even more trouble in an update situation, and 2 would possibly suffer the same problem as the ideal solution depending on how the two CSS files interacted.
Some of my live LESS compiler code is here:

https://github.com/ds125v/moodle-theme_bootstrap_renderers/blob/master/lib.php

Takes some tweaking to make it work though, not sure if I left it in a working state.

The mention of using the javascript compiler in the browser reminds me that I meant to investigate the crazy idea of compiling the less into CSS on the admin users browser during the upgrade progress.

You're right that you have to compile if there's any update to the less files in Bootstrapbase that you want to take advantage of. It's probably the biggest downside to this approach, but as long as your aware of that you can get benefits that more than counterbalance it for many circumstances (and if you control your own server you can automate it as part of the upgrade). Certainly not worth the trouble for less radical changes or for people that don't want to mess with such techy gubbins though.

Note that Moodle (long before Bootstrap) actually goes to a lot of trouble to gather up all the CSS files and turn them into a single, minified CSS file to send to the browser (with some workaround for IE<10 that can't handle really big files). It makes things go quite bit faster, particularly on bad internet connections and is generally consider a best practice for the web.

I originally looked at hooking a PHP-based less compiler into that process, so that all the changes got compiled on the fly and then cached. You could even have it in theme designer mode and instantly see changes to your less files. That had other trade-offs and different benefits and drawbacks e.g. on the good side you could get values from the user via the web interface and use those to change the colorscheme, but on the bad side the PHP port wasn't always 100% compatible with the Javascript verson. Always nice to have options though.