最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Changing the base color of a theme - Ext JS 6 - Stack Overflow

programmeradmin1浏览0评论

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 badges
Add a ment  | 

2 Answers 2

Reset to default 6

If 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.

发布评论

评论列表(0)

  1. 暂无评论