diff --git a/formatter_field.module b/formatter_field.module
index 0c8c5d6..0b3f98e 100644
--- a/formatter_field.module
+++ b/formatter_field.module
@@ -221,3 +221,42 @@ function formatter_field_field_formatter_view($entity_type, $entity, $field, $in
   return $element;
 }
 
+/**
+ * Implements hook_preprocess_field().
+ */
+function formatter_field_preprocess_field(&$variables) {
+  // Get cache data from static variable.
+  $cache = &drupal_static(__FUNCTION__, array());
+
+  // Get entity type and entity bundle from element attributes.
+  $entity_type = $variables['element']['#entity_type'];
+  $bundle = $variables['element']['#bundle'];
+
+  // If cache for the current entity type and entity bundle is empty is means
+  // that we haven't got information about field instances yet.
+  if (!isset($cache[$entity_type][$bundle])) {
+    $cache[$entity_type][$bundle] = field_read_instances(array(
+      'entity_type' => $entity_type,
+      'bundle' => $bundle,
+    ));
+  }
+
+  foreach ($cache[$entity_type][$bundle] as $formatter_instance) {
+    if (in_array($formatter_instance['widget']['module'], array('formatter_field', 'formatter_field_preset')) && $formatter_instance['settings']['field_name'] == $variables['element']['#field_name']) {
+      $formatter_items = field_get_items($variables['element']['#entity_type'], $variables['element']['#object'], $formatter_instance['field_name']);
+      $display = $formatter_items[0];
+      if ($display['type'] == 'hidden') {
+        continue;
+      }
+      if (is_string($display['settings'])) {
+        $display['settings'] = unserialize($display['settings']);
+      }
+      if ($formatter_instance['widget']['module'] == 'formatter_field_preset') {
+        $variables['classes_array'][] = 'formatter-field--' . str_replace('_', '-', $display['settings']['__formatter_field_preset']);
+      }
+      else {
+        $variables['classes_array'][] = 'formatter-field--' . str_replace('_', '-', $display['settings']['file_view_mode']);
+      }
+    }
+  }
+}
