_forms.less 3.9 KB

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