You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

608 lines
12 KiB

@import "../../style/themes/default";
@import "../../style/mixins/index";
@import "../../input/style/mixin";
@import "../../button/style/mixin";
@import "../../grid/style/mixin";
@import "./mixin";
@form-prefix-cls: ~"@{ant-prefix}-form";
@form-component-height: @input-height-base;
@form-feedback-icon-size: 14px;
10 years ago
.@{form-prefix-cls} {
.reset-component;
.reset-form;
10 years ago
}
.@{form-prefix-cls}-item-required:before {
9 years ago
display: inline-block;
margin-right: 4px;
content: "*";
font-family: SimSun;
line-height: 1;
9 years ago
font-size: @font-size-base;
color: @label-required-color;
.@{form-prefix-cls}-hide-required-mark & {
display: none;
}
9 years ago
}
// Radio && Checkbox
input[type="radio"],
input[type="checkbox"] {
&[disabled],
&.disabled {
cursor: not-allowed;
}
}
// These classes are used directly on <label>s
.@{ant-prefix}-radio-inline,
.@{ant-prefix}-radio-vertical,
.@{ant-prefix}-checkbox-inline,
.@{ant-prefix}-checkbox-vertical {
&.disabled {
cursor: not-allowed;
}
}
// These classes are used on elements with <label> descendants
.@{ant-prefix}-radio,
.@{ant-prefix}-checkbox {
&.disabled {
label {
cursor: not-allowed;
}
}
}
// Form items
// You should wrap labels and controls in .@{form-prefix-cls}-item for optimum spacing
.@{form-prefix-cls}-item {
label {
position: relative;
> .@{iconfont-css-prefix} {
vertical-align: top;
font-size: @font-size-base;
}
}
.reset-component;
margin-bottom: @form-item-margin-bottom;
vertical-align: top;
transition: margin .15s steps(1);
// nested FormItem
& > &,
& :not(.@{form-prefix-cls}) > & {
margin-bottom: -@form-item-margin-bottom;
}
&-control {
line-height: @form-component-height;
position: relative;
.clearfix;
* {
font-size: @font-size-base;
}
}
&-with-help {
margin-bottom: @form-item-margin-bottom - @font-size-base * @line-height-base;
transition: none;
}
&-label {
text-align: right;
9 years ago
vertical-align: middle;
line-height: @form-component-height;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
label {
color: @label-color;
&:after {
& when (@form-item-trailing-colon=true) {
content: ":";
}
& when not (@form-item-trailing-colon=true) {
content: " ";
}
margin: 0 8px 0 2px;
position: relative;
top: -0.5px;
}
}
}
.@{ant-prefix}-switch {
margin: 4px 0;
}
&-no-colon &-label label:after {
content: " ";
}
10 years ago
}
.@{form-prefix-cls}-explain,
.@{form-prefix-cls}-extra {
color: @text-color-secondary;
line-height: 1.5;
transition: color .15s @ease-out;
}
.@{form-prefix-cls}-extra {
padding-top: 4px;
}
.@{form-prefix-cls}-text {
display: inline-block;
padding-right: 8px;
}
.@{form-prefix-cls}-split {
display: block;
text-align: center;
10 years ago
}
// 表单下的输入框尺寸唯一: 大尺寸
form {
.has-feedback {
.@{ant-prefix}-input {
padding-right: 24px;
}
// Fix overlapping between feedback icon and <Select>'s arrow.
// https://github.com/ant-design/ant-design/issues/4431
7 years ago
> .@{ant-prefix}-select .@{ant-prefix}-select-arrow,
> .@{ant-prefix}-select .@{ant-prefix}-select-selection__clear,
:not(.@{ant-prefix}-input-group-addon) > .@{ant-prefix}-select .@{ant-prefix}-select-arrow,
:not(.@{ant-prefix}-input-group-addon) > .@{ant-prefix}-select .@{ant-prefix}-select-selection__clear {
right: 28px;
}
7 years ago
> .@{ant-prefix}-select .@{ant-prefix}-select-selection-selected-value,
:not(.@{ant-prefix}-input-group-addon) > .@{ant-prefix}-select .@{ant-prefix}-select-selection-selected-value {
padding-right: 42px;
}
.@{ant-prefix}-cascader-picker {
&-arrow {
margin-right: 21px;
}
&-clear {
right: 28px;
}
}
// Fix issue: https://github.com/ant-design/ant-design/issues/4783
.@{ant-prefix}-calendar-picker,
.@{ant-prefix}-time-picker {
&-icon,
&-clear {
right: 28px;
}
}
}
textarea.@{ant-prefix}-input {
height: auto;
}
// input[type=file]
.@{ant-prefix}-upload {
10 years ago
background: transparent;
}
input[type="radio"],
input[type="checkbox"] {
width: 14px;
height: 14px;
}
// Radios and checkboxes on same line
.@{ant-prefix}-radio-inline,
.@{ant-prefix}-checkbox-inline {
display: inline-block;
vertical-align: middle;
10 years ago
font-weight: normal;
cursor: pointer;
margin-left: 8px;
&:first-child {
margin-left: 0;
}
10 years ago
}
.@{ant-prefix}-checkbox-vertical,
.@{ant-prefix}-radio-vertical {
display: block;
10 years ago
}
.@{ant-prefix}-checkbox-vertical + .@{ant-prefix}-checkbox-vertical,
.@{ant-prefix}-radio-vertical + .@{ant-prefix}-radio-vertical {
margin-left: 0;
}
.@{ant-prefix}-input-number {
9 years ago
margin-top: -1px;
margin-right: 8px;
}
.@{ant-prefix}-select,
.@{ant-prefix}-cascader-picker {
width: 100%;
// Fix https://github.com/ant-design/ant-design/issues/6097
&:only-child {
display: block;
}
}
// Don't impact select inside input group
.@{ant-prefix}-input-group .@{ant-prefix}-select,
.@{ant-prefix}-input-group .@{ant-prefix}-cascader-picker {
width: auto;
}
// Don't impact select inside input group addon
.@{ant-prefix}-input-group-addon .@{ant-prefix}-select,
.@{ant-prefix}-input-group-addon .@{ant-prefix}-cascader-picker {
&:only-child {
display: inline-block;
}
}
10 years ago
}
// Input combined with select
.@{ant-prefix}-input-group-wrap {
.@{ant-prefix}-select-selection {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
&:hover {
border-color: @border-color-base;
}
}
.@{ant-prefix}-select-selection--single {
margin-left: -1px;
height: @input-height-base;
background-color: #eee;
.@{ant-prefix}-select-selection__rendered {
padding-left: 8px;
padding-right: 25px;
line-height: 30px;
}
}
.@{ant-prefix}-select-open .@{ant-prefix}-select-selection {
border-color: @border-color-base;
box-shadow: none;
}
}
// Form layout
//== Vertical Form
.make-vertical-layout-label() {
padding: 0 0 8px;
display: block;
text-align: left;
line-height: @line-height-base;
label:after {
display: none;
}
}
.make-vertical-layout() {
.@{form-prefix-cls}-item-label,
.@{form-prefix-cls}-item-control-wrapper {
display: block;
width: 100%;
}
.@{form-prefix-cls}-item-label {
.make-vertical-layout-label();
}
}
.@{form-prefix-cls}-vertical .@{form-prefix-cls}-item-label,
// when labelCol is 24, it is a vertical form
.@{ant-prefix}-col-24.@{form-prefix-cls}-item-label,
.@{ant-prefix}-col-xl-24.@{form-prefix-cls}-item-label {
.make-vertical-layout-label();
}
@media (max-width: @screen-xs-max) {
.make-vertical-layout();