首页 \ 问答 \ extjs 4主题如何使用全局变量来创建自定义组件(extjs 4 themes how to use global variables to create custom components)

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
更新时间:2022-08-07 18:08

最满意答案

我的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. ...
  • 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和当前移动生态系统(iOS,Android)的“生产级”移动应用程序来说并不容易解决, 由于运行通过长动态模块导入堆栈,Python应用程序启动缓慢。 当你的应用程序变得越来越复杂时,你会基本上碰壁。 Python没有很好地整合到现有的应用程序包管理模型中,这使得它比“纯粹的”本地应用程序开发更棘手。 最终,您需要混合并掌握本地开发和Python开发,为处理堆栈增加了额外的复杂性。 这是我很久以前写的一篇文章,但仍然是真实的http://opensourcehacker. ...
  • 有很多因素需要考虑,比如最大的市场在哪里,等等。 但是忽略这些因素,只考虑技术和金钱问题,明确的答案是从Android开始。 Android SDK完全免费。 iPhone开发工具需要Mac,因此如果您不是Mac用户,则需要购买Mac。 如果您不是Mac用户,那么您可能确信您不知道您需要iPhone的Objective C。 你甚至不需要电话,有一个模拟器可以很好地工作。 我做了一些在模拟器中工作但在真实手机上不起作用或工作不同的情况非常罕见。 所以模拟器非常出色。 Android编程是Java,与C#非常 ...
  • 只需找到一个您感兴趣的项目(无论是独立的,移动的还是网络的)。 只要做到这一点,你就会获得宝贵的经验,而不仅仅是项目的目标细节,而且作为一般程序员,这些技能将会延伸到其他领域。 真的只是找到一个你感兴趣的项目,你提到的任何类型都不会去哪里,所以你选择哪一个都不重要。 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摄像头读取条形码的库存管理应用程序 ...
  • 事实证明,“敏捷”是一个失误。 当时,他指的是像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 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)