Thanks Sam for your detailed explanations.
I didn't want to add additional places to search files. My proposal would be to set the theme folder as base and start each file with a path within the theme folder. In the moment each file type has a different fixed base folder:
- CSS includes now look like 'stylefile' :: after the change they can look like 'styles/stylefile' or 'myfolder/css/stylefile'
- JavaScript includes now look like 'myjs' :: after the change they can look like 'javascript/myjs' or 'myfolder/js/myjs'
- Image includes now look like '[[pix:theme|image1]]' or '[[pix:theme|subfolder/image2]]' :: after the change they can look like '[[pix:theme|pix/image1]]' or '[[pix:theme|notpixbutmyfolder/img/image2]]'
This solution demands a bit more typing for theme designers, no additional speed issues and the convenience to use a flexible folder structure which fits the theme needs.
And I think overriding in child themes still works.
And when I understand Moodle caching right file search is only done when a file is not cached. In normal production mode Moodle delivers the compacted files from the cache. This way the place where the files are originally saved does not matter at all.