Override html.twig.html within custom module According to this Drupal 7 answer, I'm looking for a Drupal 8 solution to simply print the page content within a custom html.twig.html.

namespace Drupal\custom_module\Controller;

use Drupal\Core\Controller\ControllerBase;

class CustomModuleController extends ControllerBase {

  public function content() {

    return [
        '#theme' =&gt; 'custommodule_page',
        '#type' =&gt; 'page',
    ];
  }
}


This approach seems to be working, but I am not sure how I can remove the core and theme CSS components.
You can completely take over the printed page if your return value is an extension of Symfony's Response class.

Here your return value is a render array so Drupal assumes it is to be rendered in a normal HTML page.

This complex looking diagram shows the flow of request to response:  You can read more about the diagram here: https://www.drupal.org/developing/api/8/render/pipeline

The first takeaway on that docs page is 


  Routes whose controllers return a Response object bypass the pipeline below. They rely directly on the Symfony render pipeline.


In other words, most of the complexity of that diagram covers the case where the return value of a controller is NOT a Response object. Returning a Response object cuts out what Drupal normally does to wrap the render array in the html.html.twig file.

There are a lot of examples in core of direct returning of a response object. Here is one: 

public function testFeed($use_last_modified, $use_etag, Request $request) {
  $response = new Response();

  $last_modified = strtotime('Sun, 19 Nov 1978 05:00:00 GMT');
  $etag = Crypt::hashBase64($last_modified);

  $if_modified_since = strtotime($request-&gt;server-&gt;get('HTTP_IF_MODIFIED_SINCE'));
  $if_none_match = stripslashes($request-&gt;server-&gt;get('HTTP_IF_NONE_MATCH'));

  // Send appropriate response. We respond with a 304 not modified on either
  // etag or on last modified.
  if ($use_last_modified) {
    $response-&gt;headers-&gt;set('Last-Modified', gmdate(DateTimePlus::RFC7231, $last_modified));
  }
  if ($use_etag) {
    $response-&gt;headers-&gt;set('ETag', $etag);
  }
  // Return 304 not modified if either last modified or etag match.
  if ($last_modified == $if_modified_since || $etag == $if_none_match) {
    $response-&gt;setStatusCode(304);
    return $response;
  }

  // The following headers force validation of cache.
  $response-&gt;headers-&gt;set('Expires', 'Sun, 19 Nov 1978 05:00:00 GMT');
  $response-&gt;headers-&gt;set('Cache-Control', 'must-revalidate');
  $response-&gt;headers-&gt;set('Content-Type', 'application/rss+xml; charset=utf-8');

  // Read actual feed from file.
  $file_name = drupal_get_path('module', 'aggregator_test') . '/aggregator_test_rss091.xml';
  $handle = fopen($file_name, 'r');
  $feed = fread($handle, filesize($file_name));
  fclose($handle);

  $response-&gt;setContent($feed);
  return $response;
}