You can do this with a theme suggestions alter hook:
/**
* Implements THEME_theme_suggestions_html_alter().
*/
function MYTHEME_theme_suggestions_html_alter(&$suggestions, $vars, $hook) {
// Check to see if you are on a node.
if ($node = \Drupal::routeMatch()->getParameter('node')) {
// Get the node type.
$type = $node->getType();
// Create the theme hook suggestions.
$suggestions[] = 'html__' . $type;
$suggestions[] = 'html__node_' . $type;
}
}
Of course, change "MYTHEME to your theme name. I tested this on a blog content type for example and the new template suggestions printed out after creating this hook and clearing cache.
<!-- THEME HOOK: 'html' -->
<!-- FILE NAME SUGGESTIONS:
* html--node-blog.html.twig
* html--blog.html.twig
* html--node--15.html.twig
* html--node--%.html.twig
* html--node.html.twig
x html.html.twig
-->
The new theme hooks here are:
* html--node-blog.html.twig
* html--blog.html.twig
The content type name will change accordingly in the naming suggestion.
To test, I copied html.html.twig
and named as html--node-blog.html.twig
and it worked great.