Skip to content

Commit

Permalink
feat(FormItem): lable 文字设置默认样式
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean-gao committed Apr 15, 2024
1 parent 119c8ec commit fcb834c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 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,18 +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 @@ -65,7 +66,7 @@
min-height: @form-item-height;
}
}
// 对齐方式: 右对齐
// 对齐方式: 右对齐
.@{form-item-cls}-right .@{form-item-label-cls} {
justify-content: flex-end;
}
Expand All @@ -85,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 @@ -105,7 +106,7 @@
}

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

0 comments on commit fcb834c

Please sign in to comment.