Add CSS class to a flagged node I want to add CSS classes to flagged nodes in order to theme them. 

Found the documentation How to add CSS classes to nodes, based on flags set, but this solution is for D6.

Can someone help me to figure out how to make it work with D7?
Try this in your template.php of your theme. Change MYTHEME to the name of your theme and bookmark to the machine name of your flag. And change node-flag-bookmark to the css class you want to be added to your node.

/**
 * Implements template_preprocess_node().
 */
function MYTHEME_preprocess_node(&amp;$variables) {
  $flag = flag_get_flag('bookmark'); // Machine name of your flag.
  if ($flag &amp;&amp; $flag-&gt;is_flagged($variables['node']-&gt;nid)) {
    $variables['classes_array'][] = 'node-flag-bookmark';
  }
}