isobar-us/code-standards

Back out JS only CSS script linking

rcherny opened this issue · 0 comments

The styles in the JS-only CSS file probably doesn't warrant a whole new HTTP request since the file is less than 300 lines.

    <script type="text/javascript">
        document.write('<link rel="stylesheet" href="css/generated/js-only.css">');
    </script>

This is in main.hbs — while this is a great idea and may have merit on a larger project with more styles, it is probably excessive for our purposes here.

Alternative approaches in the future might be:

  1. Load it via dynamically inserted LINK tag
  2. Inline the CSS, minified
  3. Return this technique or ... something else.

I'm going to test adding it to the SASS and having it be in the main styles. We may need to scope these rules, though they may be specific enough it may not matter.