Adding a class to a  in .theme file Using Drupal 8 and Bootstrap sub-theme. 

I see that classes are being added to my divs in the page template file using the following:

&lt;section{{ content_attributes.addClass(content_classes) }}&gt;


That's great. But what if I wanted to add additional classes to these div tags. How would I do that...in my .theme file somehow?
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)