[英]How to use custom sass in Ext JS 7
I have been trying to change the button colour in a form I have created on Ext JS v7.0.0.40我一直在尝试更改我在 Ext JS v7.0.0.40 上创建的表单中的按钮颜色
Login.js location is app\\modern\\src\\view\\main\\Login.js Login.js 位置是 app\\modern\\src\\view\\main\\Login.js
extend: "Ext.form.Panel",
xtype: "form-login",
title: "Login Form",
bodyPadding: 20,
width: 320,
autoSize: true,
items: [
{
xtype: "textfield",
allowBlank: false,
required: true,
label: "User ID",
name: "user",
placeholder: "user id"
},
{
xtype: "passwordfield",
allowBlank: false,
required: true,
label: "Password",
name: "pass",
placeholder: "password"
},
{
xtype: "checkbox",
boxLabel: "Remember me",
name: "remember"
}
],
buttons: [
{
text: "Login",
handler: "onLogin"
}
]
});
Login.sass location is app\\modern\\sass\\var\\view\\main\\Login.sass Login.sass 位置是 app\\modern\\sass\\var\\view\\main\\Login.sass
.form-login {
.button {
background-color: #ff3737;
}
}
For some reason I cannot get the color of the button to be changed, I'm sure this has a pretty simple fix.出于某种原因,我无法更改按钮的颜色,我相信这有一个非常简单的修复方法。
Thanks in advance!提前致谢!
Welcome to Stack Overflow:欢迎使用堆栈溢出:
You did not set the cls
(custom class for the element) for the form.您没有为表单设置cls
(元素的自定义类)。
And the button styling for the background-color is done in a subelement:背景颜色的按钮样式是在子元素中完成的:
scss file: .scss 文件:
.form-login {
.x-button .x-inner-el {
background-color: #ff3737;
}
}
https://fiddle.sencha.com/#view/editor&fiddle/325q https://fiddle.sencha.com/#view/editor&fiddle/325q
Further information:更多信息:
x-button
按钮 cls 是x-button
cls
and create a custom component with that style更频繁地:使用cls
并创建具有该样式的自定义组件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.