admin管理员组文章数量:1429524
Is it possible to change the base code of a theme in Ext JS without creating a new custom theme?
If there is, can someone please provide a method for doing this?
Thanks
Is it possible to change the base code of a theme in Ext JS without creating a new custom theme?
If there is, can someone please provide a method for doing this?
Thanks
Share Improve this question asked Jul 12, 2016 at 14:35 LuliLuli 411 silver badge5 bronze badges2 Answers
Reset to default 6If your application is built by Sencha Cmd, easy as cake.
From your app
directory with the javascript source code of Application.js
, navigate to ..\sass\src
.
Now create a file Application.scss
which contains:
$base-color: dynamic(#fc0)
Call sencha app build production
and you will find that your application now uses the worst yellow I could find, instead of the original blue.
(I have tested against an application with Triton theme, there are some issues with gray and classic theme because they rely on background images which are not affected by a changed base color.)
Alexander's answer is the correct one for lasting changes. If you need ad-hoc style changes, look at the Ext.util.CSS
class and its method updateRule
, which allows you to change individual styles for css classes. This requires some fiddling however, because the base color is used in many different places and also in lighter/darker variations.
swapStyleSheet
lets you change the entire theme or variations of theme overrides.
本文标签: javascriptChanging the base color of a themeExt JS 6Stack Overflow
版权声明:本文标题:javascript - Changing the base color of a theme - Ext JS 6 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745514273a2661454.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论