Adding a class to a  in .theme file
OPTION 1

In your template file, you could find the set content_classes and add another class name to the list.

{%
  set content_classes = [
    'class-name',
    'class-name-other',
  ]
%}
&lt;section{{ content_attributes.addClass(content_classes) }}&gt;


OPTION 2

In your .theme file

function themename_preprocess_html(&amp;$variables) {
  $variables['content_attributes']['class'][] = 'class-name-other';
}


Note: This preprocess is for the html.html.twig file, you need to use the correct preprocess depending on your template file name. 

If it's the node.html.twig then use function themename_preprocess_node(&amp;$variables)

If it's the page.html.twig then use function themename_preprocess_page(&amp;$variables)