extjs 4主题如何使用全局变量来创建自定义组件(extjs 4 themes how to use global variables to create custom components)
我正在尝试为ExtJS 4创建一个自定义主题,这个主题更加复杂,只需更改基本颜色即可。 所以这可能是一个关于SASS而不是主题本身的问题。
ExtJS为其所有组件声明了mixins,但对于其中的许多组件,mixin没有参数。
@mixin extjs-menu { .#{$prefix}menu-body { @include no-select; background: $menu-background-color !important; padding: $menu-padding; } ... }
例如,这是菜单mixin。 正如你所看到的,他们没有使用mixin参数; 相反,他们正在使用影响所有菜单的全局变量。
所以要修改这个组件,我做了以下工作:
$menu-background-color: red; @include ext-menu
但是当你在你的应用中有几个菜单,并且你想为每个菜单寻找不同的外观时会发生什么。 有任何想法吗?
我的想法是用我的改变创建一个mixin并调用ext菜单的mixin,但我不确定在mixin中声明
$menu-background-color: red
会不会影响全局变量。I'm trying to create a custom theme for ExtJS 4, more complex that just changing the base color. So probably this is more a question about SASS than the theme itself.
ExtJS declares mixins for all its components, but for many of these the mixin has no parameters.
@mixin extjs-menu { .#{$prefix}menu-body { @include no-select; background: $menu-background-color !important; padding: $menu-padding; } ... }
For example, this is the menu mixin. As you can see, they are not using mixin parameters; instead, they are using the global variables that affect all menus.
So to modify this component I was doing the following:
$menu-background-color: red; @include ext-menu
But what happens when you have several menus in your app and you want different looks for each. Any ideas?
My idea was to create a mixin with my changes and call the ext-menu mixin, but I'm not sure if declaring
$menu-background-color: red
inside the mixin will affect the global variable or not.
原文:https://stackoverflow.com/questions/12100609
最满意答案
我的iPod Touch上有ScrumTools。 这是一个非常基本的工具,有计划扑克牌,并计时器拳击。 它会改变你的工作方式吗? 不是由一个长镜头。 但很高兴有。
I have ScrumTools on my iPod Touch. It's a pretty basic tool that has planning poker cards, and a timer for time boxing. Will it change the way you work? Not by a long shot. But it's nice to have.
相关问答
更多-
我的iPod Touch上有ScrumTools。 这是一个非常基本的工具,有计划扑克牌,并计时器拳击。 它会改变你的工作方式吗? 不是由一个长镜头。 但很高兴有。 I have ScrumTools on my iPod Touch. It's a pretty basic tool that has planning poker cards, and a timer for time boxing. Will it change the way you work? Not by a long shot. ...
-
教程了解Java移动应用程序开发[关闭](Tutorial To learn about java mobile application development [closed])[2022-07-15]
J2ME 1. http://www.j2meforums.com/wiki/index.php/Tutorials 2. http://www.java2s.com/Tutorial/Java/0430_ J2ME / Catalog0430 _J2ME.htm 3. http://developers.sun.com/mobility/learn/midp/getstart/ J2ME 1.http://www.j2meforums.com/wiki/index.php/Tutorials 2.http ... -
我最终使用Visual Studio 2008 Pro并在C#中进行开发(因为Windows窗体的图形设计器)。 我还使用SharpDevelop(#Develop)IDE找到了另一种选择(但设置更成问题): http : //www.codeproject.com/Articles/31861/Windows-Mobile-Development-Without-Visual-Studio I ended up using Visual Studio 2008 Pro and doing developm ...
-
使用Python进行移动应用程序开发时面临的挑战[已关闭](Challenges when doing mobile application development with Python [closed])[2021-05-07]
我认为有两个问题对于使用Python和当前移动生态系统(iOS,Android)的“生产级”移动应用程序来说并不容易解决, 由于运行通过长动态模块导入堆栈,Python应用程序启动缓慢。 当你的应用程序变得越来越复杂时,你会基本上碰壁。 Python没有很好地整合到现有的应用程序包管理模型中,这使得它比“纯粹的”本地应用程序开发更棘手。 最终,您需要混合并掌握本地开发和Python开发,为处理堆栈增加了额外的复杂性。 这是我很久以前写的一篇文章,但仍然是真实的http://opensourcehacker. ... -
有很多因素需要考虑,比如最大的市场在哪里,等等。 但是忽略这些因素,只考虑技术和金钱问题,明确的答案是从Android开始。 Android SDK完全免费。 iPhone开发工具需要Mac,因此如果您不是Mac用户,则需要购买Mac。 如果您不是Mac用户,那么您可能确信您不知道您需要iPhone的Objective C。 你甚至不需要电话,有一个模拟器可以很好地工作。 我做了一些在模拟器中工作但在真实手机上不起作用或工作不同的情况非常罕见。 所以模拟器非常出色。 Android编程是Java,与C#非常 ...
-
Web Side,移动开发,独立应用程序?(Which way to go Web Side ,Mobile Development, Stand alone applications?)[2022-11-26]
只需找到一个您感兴趣的项目(无论是独立的,移动的还是网络的)。 只要做到这一点,你就会获得宝贵的经验,而不仅仅是项目的目标细节,而且作为一般程序员,这些技能将会延伸到其他领域。 真的只是找到一个你感兴趣的项目,你提到的任何类型都不会去哪里,所以你选择哪一个都不重要。 Just find a project that you find interesting (regardless of whether its standalone, mobile or web). And just work at it, ... -
一些域名似乎更适合我的头顶原生应用: 应用程序断开数据集。 移动应用程序不能总是依靠互联网连接。 原生应用很好地处理了这种情况 对于数据输入工具尤其如此。 如果您在输入数据时在浏览器中收到呼叫,则重新启动Safari后重新加载页面时可能会丢失工作。 需要用户上传媒体的应用,如照片,视频和录音。 目前,无法通过MobileSafari上传本地iPhone媒体。 本地应用处理这种情况。 保险和房地产可能是很好的市场目标。 高级处理应用。 例如,如果您想要一个可以使用iPhone摄像头读取条形码的库存管理应用程序 ...
-
移动开发工具[关闭](Mobile Development Tools [closed])[2022-05-05]
事实证明,“敏捷”是一个失误。 当时,他指的是像Mobify这样的工具,可以自动化简单移动网站的开发和部署。 但是,对于我们的情况(基于会员制的RIA),这不起作用。 但是,对于任何感兴趣的人,我找到了最好的工具: Sencha Touch 一个出色的JS库,用于为iPhone和Android构建RIA系统 GPL获得免费软件许可 还提供商业许可证 使用HTML5和CSS3提供流畅的动画和令人难以置信的“柔软”UI jQTouch 另一个很棒的JS库(Sencha实际上是基于这个)。 建立在jQuery之上 ... -
实际上,这不是真的。 如果您学习如何在Maemo中使用两个主要窗口工具包(GTK +和Qt),您将能够为各种设备编写GUI。 诺基亚已经收购了Qt的制造商Trolltech,他们已经将所有GTK +更改发布回GNOME。 这意味着Qt和GTK +都是开源的,因此您可以将它们移植到任何平台。 事实上,诺基亚已经为你做了一些移植 - 他们将Qt移植到Symbian上,后者运行在数百万部手机上。 Qt和GTK +都运行在许多平台上,而不仅仅是linux,所以你也可以用这两个工具包编写Windows程序。 请注意, ...
-
不支持WPF。 当前手机不支持Silverlight,但Windows Phone 7支持Silverlight.Windows Phone 7将支持XNA。 对于市场上现有的手机,你真的不得不放弃通过简单地将控件拖出工具箱来获得一个像样的用户界面的想法。 这根本就不会发生。 您仍然可以创建引人注目的用户界面,但您必须自定义/手动绘制控件。 WPF is not supported. Silverlight is not supported in current phones but will be sup ...