How do I define a custom html.html.twig file? I need to define custom html.html.twig file for particular url. What I did is given below:

/**
 * Implements hook_theme().
 */
function mymodule_theme() {
  return array(
    'html__ajax' =&gt; array(
      'render element' =&gt; 'elements',
    ),
  );
}
/**
 * Implements hook_theme_suggestions_HOOK().
 */
function mymodule_theme_suggestions_html(array $variables) {
  $template_suggestions = array();
  // This is used to display only ajax $content.
  if (isset($_GET['ajax']) &amp;&amp; $_GET['ajax'] == 1) {
    $template_suggestions[] = 'html__ajax';
  }
  return $template_suggestions;
}


I have copy pasted html.html.twig file from my theme and put it inside my module's template folder and renamed it as html--ajax.html.twig. Changes are reflecting fine but not all default variables are not available in my custom html.html.twig file. 

When I open the page I can see the content till Skip to main content link. Please help me what I am missing while declaring custom template file.
If you want to return 'render element' this would be 'html':

'render element' =&gt; 'html',


But you probably don't need this, better return the base hook so that drupal fetches the variables from the hook html:

function mymodule_theme() {
  return array(
    'html__ajax' =&gt; array(
      'base hook' =&gt; 'html',
    ),
  );
}