--- asset.php.orig	2009-07-30 11:47:38.000000000 +0200
+++ asset.php 2009-07-30 11:47:34.000000000 +0200
@@ -295,6 +295,9 @@
$paths = array_merge($paths, Configure::read('Asset.searchPaths'));

+ if (is_a($this->View, 'ThemeView')) {
+ array_unshift($paths, WWW_ROOT.$this->View->themeWeb.$type.DS);
+ }
if (!empty($asset['plugin']) > 0) {
$pluginPaths = Configure::read('pluginPaths');
$count = count($pluginPaths);

This patch is based on revision 388026b2444f35cb6ac4f425940832a6a03ac774 (*facepalm* for git revision numbers). It simply inserts a path to the themed webroot before the path to the regular webroot.

Note that you will have to clear the compressed CSS/JS cache when you switch themes. Since website themes hardly change every second, it's not really a problem. It can become a pain if you allow your users to select the theme of their choice, though. In that case, this patch won't be enough: you'll also have to change the compressed file name generation method.