代码拉取完成,页面将自动刷新
采用antd提供的全局样式变量。优先采用全局提供变量。如:
// config/theme/variables.less
// 下面是复写less变量,如果需要复写,可以通过以下入口挑选具体变量复写即可
@import 'antd/es/style/default';
// 修改前缀
@ant-prefix: 'ogo';
// 自定义覆盖 style
@primary-color: #154ad8;
@error-color: #f76c6f;
@border-radius-base: 4px;
@arrow-border-radius: 4px;
@component-background: #fafafa;
@layout-body-background: #eff4f9;
@layout-footer-background: @component-background;
@layout-sider-background: @component-background;
@layout-header-background: @component-background;
@layout-trigger-color-light: @component-background;
@header-height: 50px;
@padding-xs: 8px;
@margin-xs: 8px;
@margin-xxs: 4px;
@padding-xxs: 4px;
// 白色字体颜色
@white-color: #fff;
// 表格全局样式
@table-header-background: #f5f6fc;
@table-header-bg: #f5f6fc;
@descriptions-bg: #f5f6fc;
// 左侧菜单
@system-menu-active-background: #f9fbfe; //系统默认分类选中时背景颜色
@system-menu-color: #a6aec7; //系统默认分类字体颜色
@custom-menu-active-background: #e6f1ff; // 自定义分类选中时背景颜色
@tree-directory-selected-color: rgba(0, 0, 0, 0.85);
@tree-directory-selected-bg: #e6f1ff;
// form
@label-color: rgba(0, 0, 0, 0.45);
@input-bg: #f2f4f9;
@select-background: #f2f4f9;
@item-hover-bg: #f2f4f9;
@input-placeholder-color: #909399;
@border-color-base: #ebeef5; // 边框颜色
@border-color-split: #ebeef5;
@item-card-radius: 10px; // 小卡片圆角
由于,某些组件我们未定制样式,如果需要修改ant原有样式,请先从Ant提供的全局变量挑选并放入variables.less
中。
注意补充注释,表明哪个组件?
例如:
// form
@label-color: rgba(0, 0, 0, 0.45);
@input-bg: #f2f4f9;
@select-background: #f2f4f9;
@item-hover-bg: #f2f4f9;
@input-placeholder-color: #909399;
@border-color-base: #ebeef5; // 边框颜色
@border-color-split: #ebeef5;
@item-card-radius: 10px; // 小卡片圆角
样式统一写入global.less文件中,备注对应的组件, 且把组件内的所有样式
/**
WorkBench
*/
.workbench {
width: 100%;
&-main {
display: flex;
}
}
css类名使用bem规则
.main {
// 这里最终解析出 `navigation-item`
&-item {
&__active {
// 激活状态 `即 main-item__active`
}
}
}
id采用驼峰式命名
/* id */
#myDialog {
...
}
less中的变量、函数、混合、placeholder采用中划线分割
/* 变量 */
@primary-color: #154ad8;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。