how to add the value of a (list text) field as a class
For view field, please implements template_preprocess_views_view_fields()

Reference: https://www.drupal.org/node/1407442#comment-6509858

Code Example

// assume the field name is 'field_text' and
// view name is 'text and view display id is 'page'
function mymodule_preprocess_views_view_fields(&amp;$variables) {
  $view = $variables['view'];
  if ($view-&gt;name == 'test' &amp;&amp; $view-&gt;current_display == 'page') {
    foreach ($variables['fields'] as $id =&gt; $object) {
      if ($id == 'field_text') {
        $field_output = $view-&gt;style_plugin-&gt;get_field($view-&gt;row_index, $id);

        if (!empty($field_output)) {
          if ($object-&gt;element_type) {
            $class = '';
            if ($object-&gt;handler-&gt;options['element_default_classes']) {
              $class = 'field-content';
            }

            if ($classes = $object-&gt;handler-&gt;element_classes($view-&gt;row_index)) {
              if ($class) {
                $class .= ' ';
              }
              $class .=  $classes;
            }

            $class .=  ' ' . drupal_html_class("value-$field_output");

            $pre = '&lt;' . $object-&gt;element_type;
            if ($class) {
              $pre .= ' class="' . $class . '"';
            }
            $field_output = $pre . '&gt;' . $field_output . '&lt;/' . $object-&gt;element_type . '&gt;';
          }
        }
        $variables['fields'][$id]-&gt;content = $field_output;
      }
    }
  }
}


For node field, please implements template_preprocess_field()

Code Example

// Assume the field name is 'field_text'
function mytheme_preprocess_field(&amp;$variables) {
  $element = &amp;$variables['element'];
  if ($element['#field_name'] === 'field_text') {
    $value = $element['#items'][0]['value'];
    $variables['classes_array'][] = drupal_html_class("value-$value");
  }
}


Note 1: I would recommend using lower case for class name.
Note 2: view_field_name is different from node_field_name