How to serve a CSS file from Google Apps Script

Is it possible to serve a CSS file from Apps Script to a web page via @import and, if so, how?

Here is what I have in my Apps Script project:

function doGet() {
    return ContentService.createTextOutput("#topbar {display: none;}").setMimeType(ContentService.MimeType.TEXT);
}

And here is what I have on my web page:

<style>
    @import url("//script.google.com/macros/s/AKfycbzQ6UcF-f8RdARqSmLLnIztDUF-TocDcc2ZWKnXLDZfZKImcrD1/exec");
</style>

The script is published and can be accessed anonymously. It does in fact serve the text when viewed in the browser.

However, the styles on the page do not appear to take effect, nor are they even registered upon the elements which they target (#topbar), as verified using dev. tools/inspector. In other words, it’s not a case of being overridden by another rule.

Chrome displays the following notice in console:

Resource interpreted as Stylesheet but transferred with MIME type text/plain: "https://script.googleusercontent.com/a/macros/monumark.com/echo?user_content_key=EwpjT6XHtgCE9TjjZiVvMu_D8SAtW6MRfu_EAMLFwMsGtfIOxw0i_lZeakV7d_fVAoQhFdRzoggswuridc7V9N-e1iQg-Agnm5_BxDlH2jW0nuo2oDemN9CCS2h10ox_nRPgeZU6HP-ROivF5cq8Yy1TNiq6oZe8h0lmODcuY_1nzLek9VwvQZkF54xdAL-niFUG-amClvBrAUVm6NjncJhe06LYrp7Rujisx4EZAUceDIgHEbXEHQ&lib=Mp-3UT9miDqSgBd2rh0D-kk71SnnNhlD3".

Note that:

  1. Apps Script is limited in the MIME types it allows, and I don’t believe ‘text/css’ is one of them
  2. Chrome does still seem to know to interpret it as a CSS file, so I don’t think MIME type is the problem.
  3. I must use @import due to client-side restrictions for the project.
  4. I noticed here that returning a blob offers additional MIME types, but I’m unsure if that’s an applicable path to solving this problem.