Skip to content

Commit

Permalink
feat(FormItem): label 文字颜色设置为默认文字颜色,兼容跟随系统样式 (#736)
Browse files Browse the repository at this point in the history
* feat(FormItem): label 文字颜色设置为默认文字颜色,兼容跟随系统样式

* feat(FormItem): 文字颜色设置为默认颜色

* feat(FormItem): lable 文字设置默认样式
  • Loading branch information
ocean-gao committed Apr 15, 2024
1 parent 83150c2 commit f39e4a1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions components/form/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@import '../../style/mixins/index';
@import './mixin.less';


@form-cls: ~'@{cls-prefix}-form';
@form-item-cls: ~'@{cls-prefix}-form-item';
@form-item-label-cls: ~'@{form-item-cls}-label';
Expand All @@ -21,15 +20,20 @@

@form-item-height: @data-input-height-base;


// 表单布局: horizontal
.@{form-cls} {
.default();
.text();

width: 100%;
margin: @form-margin;
font-size: @form-size-base;

// 对齐方式: 左对齐
// 对齐方式: 左对齐
.@{form-item-cls} {
.default();
.text();

display: flex;
margin-bottom: @form-item-margin;
padding: @form-margin;
Expand Down Expand Up @@ -62,7 +66,7 @@
min-height: @form-item-height;
}
}
// 对齐方式: 右对齐
// 对齐方式: 右对齐
.@{form-item-cls}-right .@{form-item-label-cls} {
justify-content: flex-end;
}
Expand All @@ -82,7 +86,7 @@
// 表单布局: inline
.@{form-cls}-inline {
display: grid;
grid-gap: (@form-item-margin/2);
grid-gap: (@form-item-margin / 2);
// 默认情况下,将一行分割为 24 格, formItem 自定义占几格【默认6格】
grid-template-columns: repeat(24, minmax(0, 1fr));
align-items: center;
Expand All @@ -102,7 +106,7 @@
}

.@{form-cls} {
// formItem 必填样式
// formItem 必填样式
.@{form-item-cls} {
.@{form-item-label-cls}.@{form-item-required} {
&::before {
Expand All @@ -124,4 +128,4 @@
color: var(--f-danger-color);
font-size: @form-size-error;
line-height: 1;
}
}

0 comments on commit f39e4a1

Please sign in to comment.