UNPKG

wetrade-design

Version:

一款多语言支持Vue3的UI框架

342 lines (287 loc) 7.79 kB
@import '../../style/themes/index'; @import '../../style/mixins/index'; @import '../../input/style/mixin'; @import '../../button/style/mixin'; @import '../../grid/style/mixin'; @import './components'; @import './inline'; @import './horizontal'; @import './vertical'; @import './status'; @import './mixin'; @form-prefix-cls: ~'@{wd-prefix}-form'; @input-prefix-cls: ~'@{wd-prefix}-input'; @form-item-prefix-cls: ~'@{form-prefix-cls}-item'; @form-font-height: ceil(@font-size-base * @line-height-base); .@{form-prefix-cls} { .reset-component(); .reset-form(); .@{form-prefix-cls}-text { display: inline-block; padding-right: 8px; } // ================================================================ // = Size = // ================================================================ .formSize(@input-height) { .@{form-item-prefix-cls}-label > label { height: @input-height; } .@{form-item-prefix-cls}-control-input { min-height: @input-height; } } &-small { .formSize(@input-height-sm); } &-large { .formSize(@input-height-lg); } &-big { .formSize(@input-height-bg); } &-extra-small { .formSize(@input-height-xs); } } .explainAndExtraDistance(@num) when (@num >= 0) { padding-top: floor(@num); } .explainAndExtraDistance(@num) when (@num < 0) { margin-top: ceil(@num); margin-bottom: ceil(@num); } // ================================================================ // = Item = // ================================================================ .@{form-item-prefix-cls} { .reset-component(); margin-bottom: @form-item-margin-bottom; vertical-align: top; &:last-of-type { margin-bottom: 0; } &-with-help { margin-bottom: 0; transition: none; } &-hidden, &-hidden.@{wd-prefix}-row { // https://github.com/ant-design/ant-design/issues/26141 display: none; } // ============================================================== // = Label = // ============================================================== &-label { display: inline-block; flex-grow: 0; overflow: hidden; white-space: nowrap; text-align: right; vertical-align: middle; &-left { text-align: left; } &-wrap { overflow: unset; line-height: (@line-height-base - 0.25em); white-space: unset; } > label { position: relative; display: inline-flex; align-items: center; max-width: 100%; height: 100%; height: @form-item-label-height; color: @label-color; font-size: @form-item-label-font-size; font-weight: 400; > .@{iconfont-css-prefix} { font-size: @form-item-label-font-size; vertical-align: top; } // Required mark &.@{form-item-prefix-cls}-required:not( .@{form-item-prefix-cls}-required-mark-optional )::before { display: inline-block; margin-right: 4px; color: @label-required-color; font-size: @form-item-label-font-size; font-family: SimSun, sans-serif; line-height: 1; content: '*'; .@{form-prefix-cls}-hide-required-mark & { display: none; } } // Optional mark .@{form-item-prefix-cls}-optional { display: inline-block; margin-left: @margin-xss; color: @text-color-secondary; .@{form-prefix-cls}-hide-required-mark & { display: none; } } // Optional mark .@{form-item-prefix-cls}-tooltip { color: @text-color-secondary; cursor: help; writing-mode: horizontal-tb; margin-inline-start: @margin-xss; } // &::after { // & when (@form-item-trailing-colon=true) { // content: ':'; // } // & when not (@form-item-trailing-colon=true) { // content: ' '; // } // position: relative; // top: -0.5px; // margin: 0 @form-item-label-colon-margin-right 0 @form-item-label-colon-margin-left; // } &.@{form-item-prefix-cls}-no-colon::after { content: ' '; } } } // ============================================================== // = Input = // ============================================================== &-control { display: flex; flex-direction: column; flex-grow: 1; &:first-child:not([class^=~"'@{wd-prefix}-col-'"]):not([class*=~"' @{wd-prefix}-col-'"]) { width: 100%; } } &-control-input { position: relative; display: flex; align-items: center; min-height: @input-height-base; &-content { flex: auto; max-width: 100%; .@{input-prefix-cls}-textarea.@{input-prefix-cls}-textarea-show-count { position: relative; textarea.@{input-prefix-cls} { padding-bottom: @padding-lg - 4px; resize: none; } &::after { width: 100%; position: absolute; right: 0px; bottom: @padding-lg + 2px; color: @text-tertiary; text-align: right; padding-right: @padding-xs; font-size: @font-size-sm; } } .@{input-prefix-cls}-textarea.@{input-prefix-cls}-textarea-show-count.@{input-prefix-cls}-textarea-count-max::after { color: @fluctuation-rise-text; } } } // ============================================================== // = Explain = // ============================================================== &-explain, &-extra { clear: both; color: @text-color-secondary; font-size: @font-size-sm; line-height: @line-height-base; transition: color 0.3s @ease-out; // sync input color transition .explainAndExtraDistance((@form-item-margin-bottom - @form-font-height) / 2); } &-explain-connected { height: 0; min-height: 0; opacity: 0; } &-extra { min-height: @form-item-margin-bottom; } .@{wd-prefix}-input-textarea-show-count { &::after { margin-bottom: -22px; } } &-with-help &-explain { height: auto; min-height: @form-item-margin-bottom; opacity: 1; } } // >>>>>>>>>> Motion <<<<<<<<<< // Explain holder .@{wd-prefix}-show-help { transition: height @animation-duration-slow linear, min-height @animation-duration-slow linear, margin-bottom @animation-duration-slow @ease-in-out, opacity @animation-duration-slow @ease-in-out; &-leave { min-height: @form-item-margin-bottom; &-active { min-height: 0; } } } // Explain .@{wd-prefix}-show-help-item { overflow: hidden; transition: height @animation-duration-slow @ease-in-out, opacity @animation-duration-slow @ease-in-out, transform @animation-duration-slow @ease-in-out !important; &-appear, &-enter { transform: translateY(-5px); opacity: 0; &-active { transform: translateY(0); opacity: 1; } } &-leave-active { transform: translateY(-5px); } } // need there different zoom animation // otherwise won't trigger anim @keyframes diffZoomIn1 { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } } @keyframes diffZoomIn2 { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } } @keyframes diffZoomIn3 { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } } @import './rtl';