I am building an application in ExtJS 5.1 using Sencha Cmd.
I have the following view, located on /Web/app/app/view/guard/apps/Launcher.js:
Ext.define('Web.view.guard.apps.Launcher', {
extend: 'Ext.button.Button',
xtype: 'widget.applauncher',
scale: 'large',
border: false,
icon: 'http://upload.wikimedia.org/wikipedia/commons/a/ac/Approve_icon.svg',
iconAlign: 'top',
iconCls: 'squareImg',
bodyCls: 'launcher',
handler : function() {
var app = Ext.create('Web.view.desktop.window.Window', {
title : this.text
});
}
});
And custom CSS defined on /Web/app/sass/src/view/guard/apps/Launcher.scss:
.squareImg {
width: 64px;
height: 64px;
}
.launcher {
padding: 12px;
}
And inspecting the elements using Chrome Developer Tools, I see the components have the classes, but they match with no CSS rules, and I can't find squareImg and launcher classes on the generated CSS. What is wrong?
sencha app build.requireshierarchy. You need, somewhere, to specify that your Launcher class is required by something - probably the main App class. You should probably check that your Sass namespace is set to 'Web' - I think the default is 'Ext'.['Web.view.guard.apps.Launcher'], to myapp/Application.jsfile and now the CSS rules are applied. Also, the default workspace is the same as the name of the app generated by Sencha Cmd, so no problem there. If you're willing to write an answer, I can mark it as accepted :)