poetic/ember-cli-cordova

Add custom CSS for Cordova build only

Opened this issue · 1 comments

This may actually be a feature request and not a bug..

What I am trying to do is add some custom css rules that are only applied when building for cordova as opposed to building for the web.

Does the current plugin support this at all? Is this something that the plugin can add support for? Or should this functionality be achieved elsewhere?

Presumably this should work using the "content-for head" with an "cordova.css" defined somewhere.

I am happy to build this, just need thoughts on if you want it included and/or architectural decisions.

I have it working on my local env with just the following change to the index.js coupled with adding the following file "cordova/merges/ios/cordova.css" (This file should probably reside in app/styles and get copied across).

contentFor: function (type) {
  if (this._isTargetCordova() && type === 'head') {
    return '<link rel="stylesheet" href="assets/cordova.css">';
  }
  if (this._isTargetCordova() && type === 'body') {
    return '<script src="cordova.js"></script>';
  }
}

Right now there is no support for this. The way we are handling this requirement right now is by using ember-cli-compass-compiler so we can include Singularity.gs for the responsive grids with media queries.

This is definitely something that could be useful though, given that including compass adds to the build time of the project plus it has a lot of extras that you may not need.