_forms.less 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. //
  6. // Variables
  7. // _____________________________________________
  8. @legend-border-bottom: 1px solid @color-gray-light6;
  9. @form-field__vertical-indent__desktop: 29px;
  10. @form-calendar-icon__color: @primary__color;
  11. //
  12. // Common
  13. // _____________________________________________
  14. & when (@media-common = true) {
  15. .fieldset {
  16. .lib-form-fieldset();
  17. &:last-child {
  18. margin-bottom: @indent__base;
  19. }
  20. > .field,
  21. > .fields > .field {
  22. .lib-form-field();
  23. &.no-label {
  24. > .label {
  25. .lib-visually-hidden();
  26. }
  27. }
  28. &.choice {
  29. .label {
  30. display: inline;
  31. font-weight: normal;
  32. margin: 0;
  33. }
  34. }
  35. .label {
  36. .column:not(.main) & {
  37. font-weight: normal;
  38. }
  39. }
  40. .field.choice {
  41. margin-bottom: @indent__s;
  42. &:last-child {
  43. margin-bottom: 0;
  44. }
  45. }
  46. }
  47. }
  48. .legend + .fieldset,
  49. .legend + div {
  50. clear: both;
  51. }
  52. .legend {
  53. > span {
  54. margin-right: @indent__xs;
  55. }
  56. }
  57. fieldset.field {
  58. border: 0;
  59. padding: 0;
  60. }
  61. .field {
  62. &.date {
  63. .time-picker {
  64. display: inline-block;
  65. margin-top: @indent__s;
  66. white-space: nowrap;
  67. }
  68. }
  69. .message {
  70. &.warning {
  71. margin-top: @indent__s;
  72. }
  73. }
  74. }
  75. .select-styling() {
  76. .lib-css(appearance, none, 1);
  77. appearance: none;
  78. background-size: 30px 60px;
  79. text-indent: .01em;
  80. text-overflow: '';
  81. &::-ms-expand {
  82. display: none;
  83. }
  84. }
  85. select {
  86. .select-styling();
  87. }
  88. .field-error,
  89. div.mage-error[generated] {
  90. margin-top: 7px;
  91. }
  92. .field-error {
  93. .lib-form-validation-note();
  94. }
  95. // TEMP
  96. .field .tooltip {
  97. .lib-tooltip(right);
  98. .tooltip-content {
  99. min-width: 200px;
  100. white-space: normal;
  101. }
  102. }
  103. input:focus ~ .tooltip .tooltip-content,
  104. select:focus ~ .tooltip .tooltip-content {
  105. display: block;
  106. }
  107. ._has-datepicker {
  108. ~ .ui-datepicker-trigger {
  109. .lib-button-reset();
  110. .lib-icon-font(
  111. @_icon-font-content: @icon-calendar,
  112. @_icon-font-color: @primary__color__lighter,
  113. @_icon-font-size: @icon-calendar__font-size,
  114. @_icon-font-line-height: @icon-calendar__font-size,
  115. @_icon-font-display: block,
  116. @_icon-font-text-hide: true
  117. );
  118. display: inline-block;
  119. margin-top: -4px;
  120. vertical-align: middle;
  121. &:focus {
  122. box-shadow: none;
  123. outline: 0;
  124. }
  125. }
  126. }
  127. .field.date,
  128. .field-dob {
  129. ._has-datepicker {
  130. &:extend(.abs-field-date-input all);
  131. }
  132. }
  133. //
  134. // Sidebar forms
  135. // ---------------------------------------------
  136. .sidebar {
  137. .fieldset {
  138. margin: 0;
  139. > .field:not(.choice) >,
  140. .fields > .field {
  141. &:not(:last-child) {
  142. margin: 0 0 @form-field__vertical-indent;
  143. }
  144. .label {
  145. margin: 0 0 4px;
  146. padding: 0 0 @indent__xs;
  147. text-align: left;
  148. width: 100%;
  149. }
  150. .control {
  151. width: 100%;
  152. }
  153. }
  154. }
  155. }
  156. }
  157. //
  158. // Desktop
  159. // _____________________________________________
  160. .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
  161. .legend {
  162. .lib-css(border-bottom, @legend-border-bottom);
  163. }
  164. }