index-pure.less 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @import '../../input/style/mixin';
  4. @import '../../button/style/mixin';
  5. @import '../../grid/style/mixin';
  6. @import './components';
  7. @import './inline';
  8. @import './horizontal';
  9. @import './vertical';
  10. @import './status';
  11. @import './mixin';
  12. @form-prefix-cls: ~'@{ant-prefix}-form';
  13. @form-item-prefix-cls: ~'@{form-prefix-cls}-item';
  14. @form-font-height: ceil(@font-size-base * @line-height-base);
  15. .@{form-prefix-cls} {
  16. .reset-component();
  17. .reset-form();
  18. .@{form-prefix-cls}-text {
  19. display: inline-block;
  20. padding-right: 8px;
  21. }
  22. // ================================================================
  23. // = Size =
  24. // ================================================================
  25. .formSize(@input-height) {
  26. .@{form-item-prefix-cls}-label > label {
  27. height: @input-height;
  28. }
  29. .@{form-item-prefix-cls}-control-input {
  30. min-height: @input-height;
  31. }
  32. }
  33. &-small {
  34. .formSize(@input-height-sm);
  35. }
  36. &-large {
  37. .formSize(@input-height-lg);
  38. }
  39. }
  40. .explainAndExtraDistance(@num) when (@num >= 0) {
  41. padding-top: floor(@num);
  42. }
  43. .explainAndExtraDistance(@num) when (@num < 0) {
  44. margin-top: ceil(@num);
  45. margin-bottom: ceil(@num);
  46. }
  47. // ================================================================
  48. // = Item =
  49. // ================================================================
  50. .@{form-item-prefix-cls} {
  51. .reset-component();
  52. margin-bottom: @form-item-margin-bottom;
  53. vertical-align: top;
  54. &-with-help {
  55. margin-bottom: 0;
  56. transition: none;
  57. }
  58. &-hidden,
  59. &-hidden.@{ant-prefix}-row {
  60. // https://github.com/ant-design/ant-design/issues/26141
  61. display: none;
  62. }
  63. // ==============================================================
  64. // = Label =
  65. // ==============================================================
  66. &-label {
  67. display: inline-block;
  68. flex-grow: 0;
  69. overflow: hidden;
  70. white-space: nowrap;
  71. text-align: right;
  72. vertical-align: middle;
  73. &-left {
  74. text-align: left;
  75. }
  76. &-wrap {
  77. overflow: unset;
  78. line-height: (@line-height-base - 0.25em);
  79. white-space: unset;
  80. }
  81. > label {
  82. position: relative;
  83. display: inline-flex;
  84. align-items: center;
  85. max-width: 100%;
  86. height: @form-item-label-height;
  87. color: @label-color;
  88. font-size: @form-item-label-font-size;
  89. > .@{iconfont-css-prefix} {
  90. font-size: @form-item-label-font-size;
  91. vertical-align: top;
  92. }
  93. // Required mark
  94. &.@{form-item-prefix-cls}-required:not(.@{form-item-prefix-cls}-required-mark-optional)::before {
  95. display: inline-block;
  96. margin-right: 4px;
  97. color: @label-required-color;
  98. font-size: @form-item-label-font-size;
  99. font-family: SimSun, sans-serif;
  100. line-height: 1;
  101. content: '*';
  102. .@{form-prefix-cls}-hide-required-mark & {
  103. display: none;
  104. }
  105. }
  106. // Optional mark
  107. .@{form-item-prefix-cls}-optional {
  108. display: inline-block;
  109. margin-left: @margin-xss;
  110. color: @text-color-secondary;
  111. .@{form-prefix-cls}-hide-required-mark & {
  112. display: none;
  113. }
  114. }
  115. // Optional mark
  116. .@{form-item-prefix-cls}-tooltip {
  117. color: @text-color-secondary;
  118. cursor: help;
  119. writing-mode: horizontal-tb;
  120. margin-inline-start: @margin-xss;
  121. }
  122. &::after {
  123. & when (@form-item-trailing-colon=true) {
  124. content: ':';
  125. }
  126. & when not (@form-item-trailing-colon=true) {
  127. content: ' ';
  128. }
  129. position: relative;
  130. top: -0.5px;
  131. margin: 0 @form-item-label-colon-margin-right 0 @form-item-label-colon-margin-left;
  132. }
  133. &.@{form-item-prefix-cls}-no-colon::after {
  134. content: ' ';
  135. }
  136. }
  137. }
  138. // ==============================================================
  139. // = Input =
  140. // ==============================================================
  141. &-control {
  142. display: flex;
  143. flex-direction: column;
  144. flex-grow: 1;
  145. &:first-child:not([class^=~"'@{ant-prefix}-col-'"]):not([class*=~"' @{ant-prefix}-col-'"]) {
  146. width: 100%;
  147. }
  148. }
  149. &-control-input {
  150. position: relative;
  151. display: flex;
  152. align-items: center;
  153. min-height: @input-height-base;
  154. &-content {
  155. flex: auto;
  156. max-width: 100%;
  157. }
  158. }
  159. // ==============================================================
  160. // = Explain =
  161. // ==============================================================
  162. &-explain,
  163. &-extra {
  164. clear: both;
  165. color: @text-color-secondary;
  166. font-size: @font-size-base;
  167. line-height: @line-height-base;
  168. transition: color 0.3s @ease-out; // sync input color transition
  169. .explainAndExtraDistance((@form-item-margin-bottom - @form-font-height) / 2);
  170. }
  171. &-explain-connected {
  172. height: 0;
  173. min-height: 0;
  174. opacity: 0;
  175. }
  176. &-extra {
  177. min-height: @form-item-margin-bottom;
  178. }
  179. .@{ant-prefix}-input-textarea-show-count {
  180. &::after {
  181. margin-bottom: -22px;
  182. }
  183. }
  184. &-with-help &-explain {
  185. height: auto;
  186. min-height: @form-item-margin-bottom;
  187. opacity: 1;
  188. }
  189. }
  190. // >>>>>>>>>> Motion <<<<<<<<<<
  191. // Explain holder
  192. .@{ant-prefix}-show-help {
  193. transition: height @animation-duration-slow linear, min-height @animation-duration-slow linear,
  194. margin-bottom @animation-duration-slow @ease-in-out,
  195. opacity @animation-duration-slow @ease-in-out;
  196. &-leave {
  197. min-height: @form-item-margin-bottom;
  198. &-active {
  199. min-height: 0;
  200. }
  201. }
  202. }
  203. // Explain
  204. .@{ant-prefix}-show-help-item {
  205. overflow: hidden;
  206. transition: height @animation-duration-slow @ease-in-out,
  207. opacity @animation-duration-slow @ease-in-out, transform @animation-duration-slow @ease-in-out !important;
  208. &-appear,
  209. &-enter {
  210. transform: translateY(-5px);
  211. opacity: 0;
  212. &-active {
  213. transform: translateY(0);
  214. opacity: 1;
  215. }
  216. }
  217. &-leave-active {
  218. transform: translateY(-5px);
  219. }
  220. }
  221. // need there different zoom animation
  222. // otherwise won't trigger anim
  223. @keyframes diffZoomIn1 {
  224. 0% {
  225. transform: scale(0);
  226. opacity: 0;
  227. }
  228. 100% {
  229. transform: scale(1);
  230. opacity: 1;
  231. }
  232. }
  233. @keyframes diffZoomIn2 {
  234. 0% {
  235. transform: scale(0);
  236. opacity: 0;
  237. }
  238. 100% {
  239. transform: scale(1);
  240. opacity: 1;
  241. }
  242. }
  243. @keyframes diffZoomIn3 {
  244. 0% {
  245. transform: scale(0);
  246. opacity: 0;
  247. }
  248. 100% {
  249. transform: scale(1);
  250. opacity: 1;
  251. }
  252. }
  253. @import './rtl';