Add attribute to html and body I need to add class="no-trans" to body, also edit the html tag.
How I can edit the {{ html_attributes }} and {{ body_attributes }} ?

my html.html.twig

&lt;!DOCTYPE html&gt;
&lt;html{{ html_attributes }}&gt;
  &lt;head&gt;
    &lt;head-placeholder token="{{ placeholder_token|raw }}"&gt;
    &lt;title&gt;{{ head_title|safe_join(' | ') }}&lt;/title&gt;
    &lt;css-placeholder token="{{ placeholder_token|raw }}"&gt;
    &lt;js-placeholder token="{{ placeholder_token|raw }}"&gt;
  &lt;/head&gt;
  &lt;body{{ body_attributes }}&gt;
Here is a preprocess alternative (maybe you will need access to some info to make custom html classes).

use Drupal\Core\Template\Attribute;

/**
 * Implements template_preprocess_html().
 */
function MODULE_OR_THEME_preprocess_html(&amp;$vars) {

  if (is_array($vars['attributes'])) {
    $vars['attributes'] = new Attribute($vars['attributes']);
  }

  $vars['html_attributes']-&gt;addClass('goes-to-HTML-tag');
  $vars['attributes']-&gt;addClass('no-trans');
}