Safe to add a class attribute to the HTML element via the theme? In Drupal 8 is it safe to manually add a class attribute to the HTML element in the theme's html.html.twig file? 

&lt;html{{ html_attributes }} class="no-js"&gt;


Its working fine for me but I don't know if there are some instances where Drupal would want to add a class as part of html_attributes? If so then presumably my output would be this:

&lt;html class="drupals-class" class="no-js"&gt;
You should use .addclass():

&lt;html{{ html_attributes.addClass('no-js') }}&gt;


That would prevent the output in the example from your question and the result will be:

&lt;html class="drupals-class no-js"&gt;