ember-css-routes

An Ember route-centric approach to serving CSS.

Usage no npm install needed!

<script type="module">
  import emberCssRoutes from 'https://cdn.skypack.dev/ember-css-routes';
</script>

README

Ember CSS Routes

This is an Ember add-on to allow CSS files to be broken up and served based on routes, rather than forcing a single CSS file for the entire application on initial load.

Usage

The add-on looks for and compiles all files named styles within your app/styles folder. These are mapped to route based on the folder structure.

Ex: app/styles/planet/earth/styles.scss will be output as assets/profile/view/styles.css and loaded on the profile/view route.

Note: current version has been verified to work with broccoli-sass and normal CSS

Route Opt-out

The implementation attempts to load a stylesheet for all routes. In order to opt-out of loading a stylesheet, simply add the property noCSS: true to that route. Example:

export default Ember.Route.extend({
  noCSS: true
});