diff --git a/libraries.module b/libraries.module
index 194e287..a6e6237 100644
--- a/libraries.module
+++ b/libraries.module
@@ -340,13 +340,34 @@ function &libraries_info($name = NULL) {
 
   if (!isset($libraries)) {
     $libraries = array();
-    // Gather information from hook_libraries_info().
+    // Gather information from implementations of hook_libraries_info() from
+    // enabled modules ...
     foreach (module_implements('libraries_info') as $module) {
       foreach (module_invoke($module, 'libraries_info') as $machine_name => $properties) {
         $properties['module'] = $module;
         $libraries[$machine_name] = $properties;
       }
     }
+    // ... and the active theme (and potential base themes). This code is
+    // borrowed from drupal_alter().
+    global $theme, $base_theme_info;
+    if (isset($theme)) {
+      $theme_keys = array();
+      foreach ($base_theme_info as $base) {
+        $theme_keys[] = $base->name;
+      }
+      $theme_keys[] = $theme;
+      foreach ($theme_keys as $theme_key) {
+        $function = $theme_key . '_' . 'libraries_info';
+        if (function_exists($function)) {
+          foreach ($function() as $machine_name => $properties) {
+            $properties['theme'] = $theme_key;
+            $libraries[$machine_name] = $properties;
+          }
+        }
+      }
+    }
+ 
     // Gather information from .info files.
     // .info files override module definitions.
     foreach (libraries_scan_info_files() as $machine_name => $file) {
