问题描述
我最近开始为Sencha创建ExtJS 5的自定义主题.
I recently started to create custom theme for ExtJS 5 by Sencha.
跟随 http://docs.sencha.com/extjs/5.0 .0/core_concepts/theming.html 我设法创建了ThemeDemoApp,继承了ext-theme-neptune
,将$base-color
更改为绿色,并使用my-custom-theme
刷新/重建了ThemeDemoApp.很好.
Following http://docs.sencha.com/extjs/5.0.0/core_concepts/theming.html I managed to create ThemeDemoApp, inherit ext-theme-neptune
, change $base-color
to green and refresh/rebuild ThemeDemoApp with my-custom-theme
. All ok.
我的问题是, ThemeDemoApp不能很好地测试自定义主题.面板,选项卡,按钮和模式窗口.就是这样吗?
My problem is, ThemeDemoApp is quite poor for testing a custom theme. A panel, tab, button and a modal window. That's it?
经过一番谷歌搜索,我碰到了 http://dev .sencha.com/ext/5.0.0/examples/themes/index.html . (为什么在指南中没有提到?!)标题说:根据捆绑的Ext主题或您自己的自定义主题查看和测试每个Ext组件.
After bit of googling I bumped into http://dev.sencha.com/ext/5.0.0/examples/themes/index.html. (Why isn't this mentioned in the guide?!) Heading says: View and test every Ext component against bundled Ext Themes, or your own custom themes.
我的问题是:如何?如何针对此示例测试自己的自定义主题?我是否必须深入研究源代码(themes.js)并自己构建此类页面/应用程序?
My question is: How? How do I test my own custom theme against this example? Do I have to dig into the source (themes.js) and build such page/application myself?
推荐答案
ExtJS下载中包含示例(包括主题测试器).
The examples - including the Theme tester - is included in the ExtJS download.
您可以通过编辑shared/options-toolbar.js
文件来修改可用的主题列表.
You can modify the list of themes available by editing the shared/options-toolbar.js
file.
要找到主题,您需要将其命名为其他主题(ext-theme-name
),或相应地修改themes.js
.
To get it to find your theme, you'll either need to name it similar to the others (ext-theme-name
), or modify themes.js
accordingly.
或者您也可以破解theme.js
文件来对您的主题进行硬编码.
Or you could just hack the theme.js
file to hardcode your theme.
(Ext JS 4曾经自动为主题创建一个示例页面-尽管现在似乎没有这样做)
(Ext JS 4 used to create an example page for themes automatically - it doesn't seem to do that now, though)
这篇关于ExtJS 5自定义主题测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!