ecr

ember-css-routes

An Ember route-centric approach to serving CSS.

Showing:

Popularity

Downloads/wk

2

GitHub Stars

10

Maintenance

Last Commit

6yrs ago

Contributors

2

Package

Dependencies

0

Size (min+gzip)

0.5KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

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

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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100