Extjs4 如何确定重置CSS的范围,以便使用scopeResetCSS属性将其应用于Ext组件?
如何将ExtCSS设置为仅应用于Ext组件 这是Extjs4 如何确定重置CSS的范围,以便使用scopeResetCSS属性将其应用于Ext组件?,extjs4,Extjs4,如何将ExtCSS设置为仅应用于Ext组件 这是scopeResetCSS的Ext文档中提到的内容: scopeResetCSS : Boolean True to scope the reset CSS to be just applied to Ext components. Note that this wraps root containers with an additional element. Also remember that when you turn on this o
scopeResetCSS
的Ext文档中提到的内容:
scopeResetCSS : Boolean
True to scope the reset CSS to be just applied to Ext components.
Note that this wraps root containers with an additional element.
Also remember that when you turn on this option, you have to use ext-all-scoped
{ unless you use the bootstrap.js to load your javascript, in which case it will be
handled for you.
我已经设置了
Ext.scopeResetCSS=true
&还将ext all.css
替换为ext all scoped.css
,但这没有帮助。感谢Donald Sipe在他的文章中发布了解决方案
在通过Ext debug.js
script加载Ext对象之前,应按以下方式创建Ext对象:
<script>
// Here we define Ext for the first time
Ext = {
buildSettings:{
"scopeResetCSS": true // Thanks, but I'll do my own scoping please
}
};
</script>
<script src="js/libs/ext/4.0.2a/ext-all-debug.js"></script>
//这里我们首次定义了Ext
分机={
构建设置:{
“scopeResetCSS”:正确//谢谢,但我会自己确定范围
}
};
通过在
buildSettings
config对象中设置scopeResetCSS
值,您告诉ExtJS您将自己处理CSS作用域。例如,要获得灰色主题的作用域版本:
/ExtJs/resources/Sass
ext all gray.scss
$scope reset css:true代码>位于文件顶部
compass compile ext all gray scoped.scss
这将在css文件夹中创建一个文件ext all gray scoped.css
,您现在可以使用它