_tables.less 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. //
  6. // Common
  7. // _____________________________________________
  8. & when (@media-common = true) {
  9. .table-wrapper {
  10. margin-bottom: @indent__base;
  11. }
  12. table {
  13. .lib-table-caption();
  14. }
  15. .table {
  16. tfoot {
  17. .lib-css(background, @sidebar__background-color);
  18. > tr {
  19. &:first-child {
  20. th,
  21. td {
  22. border-top: @table__border-width @table__border-style @table__border-color;
  23. padding-top: @indent__base;
  24. }
  25. }
  26. }
  27. th,
  28. td {
  29. border: 0;
  30. }
  31. .mark {
  32. font-weight: @font-weight__regular;
  33. text-align: right;
  34. }
  35. }
  36. }
  37. }
  38. //
  39. // Mobile
  40. // _____________________________________________
  41. .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
  42. .table-wrapper {
  43. border-top: @table__border-width @table__border-style @table__border-color;
  44. .lib-table-overflow();
  45. position: relative; // To hide unnecessary horizontal scrollbar in Safari
  46. .table:not(.totals):not(.cart):not(.table-comparison) {
  47. .lib-table-responsive();
  48. tbody {
  49. > tr {
  50. > td:first-child {
  51. padding-top: 15px;
  52. }
  53. > td:last-child {
  54. border-bottom: @table__border-width @table__border-style @table__border-color;
  55. padding-bottom: 15px;
  56. }
  57. > td.col.qty {
  58. text-align: left;
  59. }
  60. }
  61. }
  62. &.additional-attributes {
  63. tbody {
  64. th {
  65. &:extend(.abs-no-display-s all);
  66. }
  67. td {
  68. &:last-child {
  69. border: none;
  70. padding: 0 0 @indent__xs;
  71. }
  72. }
  73. }
  74. }
  75. }
  76. .table:not(.totals):not(.table-comparison) {
  77. tfoot {
  78. display: block;
  79. tr {
  80. display: block;
  81. &:extend(.abs-add-clearfix-mobile all);
  82. &:first-child {
  83. th,
  84. td {
  85. padding-top: @indent__base;
  86. }
  87. }
  88. }
  89. .mark {
  90. box-sizing: border-box;
  91. float: left;
  92. text-align: left;
  93. width: 70%;
  94. }
  95. .amount {
  96. box-sizing: border-box;
  97. float: left;
  98. text-align: right;
  99. width: 30%;
  100. }
  101. .grand.totals {
  102. .lib-font-size(16);
  103. .amount {
  104. padding-bottom: @indent__s;
  105. }
  106. }
  107. }
  108. }
  109. }
  110. .data-table-definition-list {
  111. thead {
  112. display: none;
  113. }
  114. tbody th {
  115. padding-bottom: 0;
  116. }
  117. tbody {
  118. th,
  119. td {
  120. display: block;
  121. padding-left: 0;
  122. padding-right: 0;
  123. }
  124. }
  125. }
  126. }
  127. //
  128. // Desktop
  129. // _____________________________________________
  130. .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) {
  131. .table {
  132. .lib-table-bordered(
  133. @_table_type: horizontal_body
  134. );
  135. }
  136. }