isobar-us / code-standards

Isobar Front-end development coding standards. Memorize them BY HEART.
https://isobar-us.github.io/code-standards/
1.34k stars 422 forks source link

Back out JS only CSS script linking #125

Closed rcherny closed 9 years ago

rcherny commented 9 years ago

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.