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.

475 lines
8.7 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";
10 years ago
.reset-form();
label {
position: relative;
> .@{iconfont-css-prefix} {
vertical-align: top;
font-size: @font-size-base;
}
10 years ago
}
.@{form-prefix-cls}-item-required:before {
9 years ago
display: inline-block;
margin-right: 4px;
content: "*";
font-family: SimSun;
font-size: @font-size-base;
color: @label-required-color;
}
// 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 {
font-size: @font-size-base;
margin-bottom: @form-item-margin-bottom;
8 years ago
color: @text-color;
vertical-align: top;
// nested FormItem
& > &,
& :not(.@{form-prefix-cls}) > & {
margin-bottom: -@form-item-margin-bottom;
}
&-control {
line-height: 32px;
position: relative;
.clearfix;
}
&-with-help {
margin-bottom: @form-item-margin-bottom - @font-size-base * @line-height-base;
}
&-label {
text-align: right;
9 years ago
vertical-align: middle;
padding: 7px 0;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
label {
color: @label-color;
&:after {
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 {
line-height: 1.5;
}
.@{form-prefix-cls}-explain,
.@{form-prefix-cls}-extra {
color: @text-color-secondary;
}
.@{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;
}
}
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%;
}
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-lg;
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;
}
}
10 years ago
// Form layout
//== Horizontal Form
.@{form-prefix-cls}-horizontal {
.@{form-prefix-cls}-item {
10 years ago
.make-row;
}
.@{ant-prefix}-radio-inline,
.@{ant-prefix}-checkbox-inline {
vertical-align: baseline;
}
10 years ago
}
// Form layout
//== Vertical Form
.@{form-prefix-cls}-vertical {
.@{form-prefix-cls}-item-label {
padding: 0 0 8px;
label:after {
content: '';
}
}
}
10 years ago
//== Inline Form
.@{form-prefix-cls}-inline {
.@{form-prefix-cls}-item {
display: inline-block;
margin-right: 10px;
margin-bottom: 0;
&-with-help {
margin-bottom: 24px;
}
9 years ago
> div {
display: inline-block;
vertical-align: middle;
9 years ago
}
}
10 years ago
.@{form-prefix-cls}-text {
display: inline-block;
}
10 years ago
.has-feedback {
display: inline-block;
}
// Fix https://github.comdesigndesign/issues/1040
.@{form-prefix-cls}-explain {
position: absolute;
}
}
10 years ago
.@{form-prefix-cls}-horizontal,
.@{form-prefix-cls}-inline {
label {
10 years ago
> input[type="radio"],
> input[type="checkbox"] {
margin-right: 4px;
10 years ago
}
10 years ago
}
}
10 years ago
// Validation state
.has-success,
.has-warning,
.has-error,
.is-validating {
&.has-feedback:after {
position: absolute;
top: 0;
right: 0;
visibility: visible;
pointer-events: none;
.square(@input-height-lg);
line-height: @input-height-lg;
text-align: center;
font-size: @font-size-lg;
animation: zoomIn .3s @ease-out-back;
.iconfont-font("");
}
}
.has-success {
9 years ago
&.has-feedback:after {
animation-name: diffZoomIn1 !important;
}
}
.has-error {
9 years ago
&.has-feedback:after {
animation-name: diffZoomIn2 !important;
}
}
.has-warning {
&.has-feedback:after {
animation-name: diffZoomIn3 !important;
}
}
10 years ago
.has-success {
.@{ant-prefix}-input {
border-color: @input-border-color;
box-shadow: none;
}
&.has-feedback:after {
content: '\e630';
color: @success-color;
}
10 years ago
}
10 years ago
.has-warning {
.form-control-validation(@warning-color; @warning-color;);
&.has-feedback:after {
content: '\e62c';
color: @warning-color;
}
//select
.@{ant-prefix}-select {
&-selection {
border-color: @warning-color;
}
&-open .@{ant-prefix}-select-selection,
&-focused .@{ant-prefix}-select-selection {
.active(@warning-color);
}
}
// arrow and icon
.@{ant-prefix}-calendar-picker-icon:after,
.@{ant-prefix}-picker-icon:after,
.@{ant-prefix}-select-arrow,
.@{ant-prefix}-cascader-picker-arrow {
color: @warning-color;
}
//input-number, timepicker
.@{ant-prefix}-input-number,
.@{ant-prefix}-time-picker-input {
border-color: @warning-color;
&-focused,
&:focus {
.active(@warning-color);
}
&:not([disabled]):hover {
border-color: @warning-color;
}
}
10 years ago
}
10 years ago
.has-error {
.form-control-validation(@error-color; @error-color;);
&.has-feedback:after {
content: '\e62e';
color: @error-color;
}
//select
.@{ant-prefix}-select {
&-selection {
border-color: @error-color;
}
&-open .@{ant-prefix}-select-selection,
&-focused .@{ant-prefix}-select-selection {
.active(@error-color);
}
}
// arrow and icon
.@{ant-prefix}-calendar-picker-icon:after,
.@{ant-prefix}-picker-icon:after,
.@{ant-prefix}-select-arrow,
.@{ant-prefix}-cascader-picker-arrow {
color: @error-color;
}
//input-number, timepicker
.@{ant-prefix}-input-number,
.@{ant-prefix}-time-picker-input {
border-color: @error-color;
&-focused,
&:focus {
.active(@error-color);
}
&:not([disabled]):hover {
border-color: @error-color;
}
}
.@{ant-prefix}-mention-wrapper {
.@{ant-prefix}-mention-editor {
&,
&:not([disabled]):hover {
border-color: @error-color;
}
}
&.active .@{ant-prefix}-mention-editor,
.@{ant-prefix}-mention-editor:not([disabled]):focus {
.active(@error-color);
}
}
}
.is-validating {
&.has-feedback:after {
display: inline-block;
animation: loadingCircle 1s infinite linear;
content: "\e6ae";
color: @text-color-secondary;
}
10 years ago
}
.@{ant-prefix}-advanced-search-form {
.@{form-prefix-cls}-item {
margin-bottom: 16px;
}
.@{ant-prefix}-input,
.@{ant-prefix}-input-group .@{ant-prefix}-input,
.@{ant-prefix}-input-group .@{ant-prefix}-input-group-addon {
height: 28px;
}
}
// need there different zoom animation
// otherwise won't trigger anim
@keyframes diffZoomIn1 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@keyframes diffZoomIn2 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@keyframes diffZoomIn3 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}