Ember.js 将自定义主题与ember引导加载项一起使用
我使用的余烬引导插件,这是工作良好,但我想使用的蔚蓝主题从。如果我只是覆盖bower_components/bootstrap/dist/CSS中的.CSS文件,那么我希望下次执行Ember.js 将自定义主题与ember引导加载项一起使用,ember.js,Ember.js,我使用的余烬引导插件,这是工作良好,但我想使用的蔚蓝主题从。如果我只是覆盖bower_components/bootstrap/dist/CSS中的.CSS文件,那么我希望下次执行bower安装或升级ember时它们会被覆盖。请告诉我如何解决这个问题?首先,您需要手动安装引导程序: $ bower install bootstrap --save 然后编辑ember-cli-build.js,使其看起来像: var EmberApp = require('ember-cli/lib/brocc
bower安装或升级ember时它们会被覆盖。请告诉我如何解决这个问题?首先,您需要手动安装引导程序:
$ bower install bootstrap --save
然后编辑ember-cli-build.js,使其看起来像:
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// If you do not use ember-bootstrap - then you can omit these lines
'ember-bootstrap': {
'importBootstrapCSS': false
}
});
app.import(app.bowerDirectory + '/bootstrap/dist/css/bootstrap.css');
app.import(app.bowerDirectory + '/bootstrap/dist/js/bootstrap.js');
app.import(app.bowerDirectory + '/bootstrap/dist/fonts/glyphicons-halflings-regular.woff', {
destDir: 'fonts'
});
return app.toTree();
};
现在您已经有了完全工作的引导。要添加Celurian主题,请将其bootstrap.css复制到vendor/
目录。
然后从ember cli build.js
中删除原始的bootstrap.css
,并添加主题css:
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// If you do not use ember-bootstrap - then you can omit these lines
'ember-bootstrap': {
'importBootstrapCSS': false
}
});
//app.import(app.bowerDirectory + /bootstrap/dist/css/bootstrap.css');
// The name does not matter, default bootstrap.css will work as well
app.import('vendor/celurian.css');
app.import(app.bowerDirectory + '/bootstrap/dist/js/bootstrap.js');
app.import(app.bowerDirectory + '/bootstrap/dist/fonts/glyphicons- halflings-regular.woff', {
destDir: 'fonts'
});
return app.toTree();
};
因此,本质上,您需要将所需文件添加到vendor
目录中,并将其导入ember cli build.js
另一种方法是使用SASS,只从app.scss
导入所需文件