How to attach css to bean preprocess? So we define the function with this hook...

/**
 * Implements hook_preprocess_bean().
 */
function MODULE_preprocess_bean(&amp;$variables) {

  // Attach css...

  return $variables;
}


What can this be attached to please?

$variables['SOMETHING']['#attached']['css'][] = drupal_get_path('module', 'MODULE') . '/MODULE.css';
It can be attached to whatever you like - the important thing is that you render it.

So you could quite simply use:

$foo['#attached']['css'][] = drupal_get_path('module', 'MODULE') . '/MODULE.css';
drupal_render($foo);


Or stick it in a var like you're already doing:

$variables['SOMETHING']['#attached']['css'][] = drupal_get_path('module', 'MODULE') . '/MODULE.css';


And in the template:

drupal_render($SOMETHING);


It works because drupal_render() unconditionally calls drupal_process_attached() on any element it finds with an #attached property, regardless of what you're doing with the result of the render (or if there's even anything to render).