DanWebb / ember-css-routes

An Ember route-centric approach to serving CSS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
});

Using The beforeModel Hook

With the current implementation, if you need to use the beforeModel hook on your route, you'll need to call this._super() from inside and return the promise generated by it. Otherwise, the CSS won't load.

Looking for a way to resolve this dependency currently.

About

An Ember route-centric approach to serving CSS.

License:MIT License


Languages

Language:JavaScript 82.1%Language:HTML 17.1%Language:CSS 0.8%