css - 为 ANTD 扩展或自定义 LESS Mixins
问题描述
是否可以为 ANTD 扩展或自定义 LESS Mixins?
例如,我希望我的按钮在悬停时变暗(而不是变亮)。查看代码,我看到有一个 mixin 可以做到这一点。
https://github.com/ant-design/ant-design/blob/master/components/button/style/mixin.less#L28-L62
.button-variant-primary(@color; @background) {
.button-color(@color; @background; @background);
text-shadow: @btn-text-shadow;
box-shadow: @btn-primary-shadow;
&:hover,
&:focus {
& when (@theme = dark) {
.button-color(
@color; ~`colorPalette('@{background}', 7) `; ~`colorPalette('@{background}', 7) `
);
}
& when not (@theme = dark) {
.button-color(
@color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `
);
}
}
我尝试用自己的方法覆盖这个 mixin,并在导入 AntD Less 文件之前和之后放置它,但这没有用。
这可能吗?
解决方案
推荐阅读
- python - Mainloop 似乎只在 tkinter 中运行一次
- powershell - 使用 PowerShell 通过 CSV 将多个 AD 用户添加到多个组 列是组名而不是标题 组名下的用户
- sharepoint - Sharepoint 列表中的列验证
- javascript - 无法在 JS 中暂停音频播放
- r - 用循环填充最后一个已知存储字段的 NA
- c - 如何有效地遍历 base-2 向量
- linux - Linux Nginx 反向代理不提供自定义 error.html
- git - 如何让 SonarQube 检测到非主分支?
- python - 如何在python中打开格式为[[skill1,skill2,skill3,...],[skill1,skill4,skill6,...],...]的大文本文件
- django - 如何让 UpdateView 与通用 FormView 一起工作