How to theme back end forms created by a custom module?
One option is to add a prefix and suffix to your form arrays

$form['name'] = array(
  '#type' =&gt; 'textfield',
  '#title' =&gt; $this-&gt;t('Name'),
  '#required' =&gt; TRUE
  '#prefix' =&gt; '&lt;div class="something"&gt;',     
  '#suffix' =&gt; '&lt;/div&gt;',
);

$form['#attached']['css'] = array(
 'path/to/my.css' =&gt; array(
   'group' =&gt; CSS_AGGREGATE_THEME,
   'weight' =&gt; 999
 ),
);


my.css

.something { 
  border: solid red;
}