Add css to theme function
Yes, arguments can be passed when calling the theme function:

$tpl_data = array(
    'data1' =&gt; $data1,
    'data2' =&gt; $data2,
);

return theme('my_theme', $tpl_data);


Then in the template $data1 and $data2 will be available.

To add a variable passed here to the default drupal class variable in the template we could add the line:

$class .= " $data1";


before the $class variable is printed. 

However I think it's questionable  whether or not this method is preferable to your original.