diff --git a/theme/mimemail.theme.inc b/theme/mimemail.theme.inc
index 9742123..830620f 100644
--- a/theme/mimemail.theme.inc
+++ b/theme/mimemail.theme.inc
@@ -103,14 +103,7 @@ function template_preprocess_mimemail_message(&$variables) {
   // If no mail.css was found and the site style sheets including is enabled,
   // gather all style sheets and embed a version of all style definitions.
   elseif ($sitestyle) {
-    $css_all = drupal_add_css();
-    $css_files = array();
-    foreach ($css_all as $key => $options) {
-      if ($options['group'] == CSS_THEME && $options['type'] == 'file' &&
-         ($options['media'] == 'all' || $options['media'] == 'screen')) {
-        $css_files[$key] = $options;
-      }
-    }
+    $css_files = _mimemail_get_theme_css_files($theme);
     // Grab local.css if it exists (support for Fusion based themes).
     $local = $themepath . '/css/local.css';
     if (@file_exists($local)) {
@@ -233,3 +226,70 @@ function _mimemail_get_theme() {
 
   return $theme;
 }
+
+/**
+ * Helper function to generate the CSS array for an specific theme.
+ * @param $theme theme name
+ */
+function _mimemail_get_theme_css_files($theme) {
+  $cache = &drupal_static(__FUNCTION__, array());
+  if (!isset($cache[$theme])) {
+    $themes = list_themes();
+
+    // Find all our ancestor themes and put them in an array.
+    $base_theme = array();
+    $ancestor = $theme;
+    while ($ancestor && isset($themes[$ancestor]->base_theme)) {
+      $ancestor = $themes[$ancestor]->base_theme;
+      $base_theme[] = $themes[$ancestor];
+    }
+
+    // Prepare stylesheets from this theme as well as all ancestor themes.
+    // We work it this way so that we can have child themes override parent
+    // theme stylesheets easily.
+    $final_stylesheets = array();
+
+    // Grab stylesheets from base theme
+    foreach ($base_theme as $base) {
+      if (!empty($base->stylesheets)) {
+        foreach (array('all', 'screen') as $media) {
+          $stylesheets = isset($base->stylesheets[$media]) ? $base->stylesheets[$media] : array();
+          foreach ($stylesheets as $name => $stylesheet) {
+            $final_stylesheets[$media][$name] = $stylesheet;
+          }
+        }
+      }
+    }
+
+    // Add stylesheets used by this theme.
+    if (!empty($theme->stylesheets)) {
+      foreach (array('all', 'screen') as $media) {
+        $stylesheets = isset($theme->stylesheets[$media]) ? $theme->stylesheets[$media] : array();
+        foreach ($stylesheets as $name => $stylesheet) {
+          $final_stylesheets[$media][$name] = $stylesheet;
+        }
+      }
+    }
+
+    // We are going to make a copy of the current array generated via drupal_add_css
+    // as long as it has been generated via the current theme.
+    // Once all the structure is built for mimeme mail theme we will restore the copy
+    // to not break any future behaviour in the request.
+    $css = &drupal_static('drupal_add_css', array());
+    $css_copy = $css;
+    $css = array();
+
+    // And now add the stylesheets properly
+    foreach ($final_stylesheets as $media => $stylesheets) {
+      foreach ($stylesheets as $stylesheet) {
+        drupal_add_css($stylesheet, array('group' => CSS_THEME, 'every_page' => TRUE, 'media' => $media));
+      }
+    }
+
+    // Get the CSS array generated via drupal_add_css and restore the copy.
+    $cache[$theme] = drupal_add_css();
+    $css = $css_copy;
+  }
+
+  return $cache[$theme];
+}
