_mini-cart.scss 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /**
  2. * Mini-cart
  3. */
  4. body[class*="woocommerce"] #page { // adding #page here to override default wc styles without !important
  5. .wc-block-grid__product-add-to-cart .added_to_cart {
  6. display: inline-block;
  7. text-decoration: none;
  8. }
  9. .main-navigation {
  10. // Mobile menu toggle
  11. #toggle-cart {
  12. display: inline-block;
  13. margin: 0;
  14. .svg-icon {
  15. vertical-align: middle;
  16. }
  17. }
  18. // Checkbox hack
  19. #woocommerce-toggle:checked ~ div {
  20. display: inline-block;
  21. }
  22. #woocommerce-toggle:focus + #toggle-cart {
  23. background-color: #{map-deep-get($config-header, "main-nav", "color", "link-hover")};
  24. outline: inherit;
  25. text-decoration: underline;
  26. }
  27. #woocommerce-toggle:checked + #toggle-cart {
  28. .open {
  29. display: none;
  30. }
  31. .close {
  32. display: inline;
  33. }
  34. }
  35. @include media(mobile-only) {
  36. .woocommerce-menu-container {
  37. background-color: map-deep-get($config-woocommerce, "mini-cart", "color", "background");
  38. color: map-deep-get($config-woocommerce, "mini-cart", "color", "text");
  39. padding: 0;
  40. width: 100%;
  41. a,
  42. a:link,
  43. a:visited {
  44. color: currentColor;
  45. }
  46. }
  47. }
  48. @include media(mobile) {
  49. & > div:not(:last-of-type) {
  50. margin-right: #{ 2 * map-deep-get($config-global, "spacing", "horizontal")};
  51. }
  52. #toggle-cart {
  53. display: none;
  54. }
  55. }
  56. .woocommerce-cart-link {
  57. display: none;
  58. text-decoration: none;
  59. line-height: 1;
  60. & > *:not(:last-child) {
  61. margin-right: #{0.25 * map-deep-get($config-global, "spacing", "horizontal")};
  62. }
  63. .woocommerce-cart-subtotal {
  64. color: #{map-deep-get($config-woocommerce, "mini-cart", "color", "subtotal")};
  65. }
  66. .woocommerce-cart-count {
  67. color: #{map-deep-get($config-woocommerce, "mini-cart", "color", "count")};
  68. font-weight: normal;
  69. }
  70. .svg-icon {
  71. float: left;
  72. height: #{map-deep-get($config-header, "main-nav", "font", "size")};
  73. width: #{map-deep-get($config-header, "main-nav", "font", "size")};
  74. vertical-align: middle;
  75. }
  76. @include media(mobile) {
  77. display: inline-block;
  78. }
  79. }
  80. .woocommerce-cart-widget {
  81. background-color: map-deep-get($config-woocommerce, "mini-cart", "color", "background");
  82. color: map-deep-get($config-woocommerce, "mini-cart", "color", "text");
  83. max-width: 100%;
  84. padding: #{map-deep-get($config-header, "main-nav", "link-padding")} 0;
  85. @include media(mobile) {
  86. max-width: #{20 * map-deep-get($config-global, "spacing", "horizontal")};
  87. padding: #{map-deep-get($config-header, "main-nav", "link-padding")};
  88. }
  89. .woocommerce.widget_shopping_cart .cart_list {
  90. border-bottom: 1px solid map-deep-get($config-woocommerce, "mini-cart", "color", "border");
  91. li {
  92. border-top: 1px solid map-deep-get($config-woocommerce, "mini-cart", "color", "border");
  93. }
  94. a:hover,
  95. a:focus {
  96. background-color: transparent;
  97. }
  98. a.remove:hover,
  99. a.remove:focus {
  100. text-decoration: none;
  101. }
  102. }
  103. .woocommerce-mini-cart__total {
  104. text-align: right;
  105. }
  106. .woocommerce-mini-cart__buttons {
  107. text-align: right;
  108. a {
  109. clear: right;
  110. color: map-deep-get($config-woocommerce, "mini-cart", "button", "color");
  111. background-color: map-deep-get($config-woocommerce, "mini-cart", "button", "background-color");
  112. margin: 0;
  113. float: right;
  114. // Default WooCommerce View Cart/Checkout buttons
  115. &:first-child:nth-last-child(2),
  116. &:first-child:nth-last-child(2) ~ a {
  117. clear: inherit;
  118. float: inherit;
  119. margin-bottom: 0;
  120. &:not(:last-child) {
  121. margin-right: #{0.5 * map-deep-get($config-global, "spacing", "horizontal")};
  122. }
  123. }
  124. &:not(:last-child) {
  125. margin-bottom: #{0.5 * map-deep-get($config-global, "spacing", "horizontal")};
  126. }
  127. &.wcppec-cart-widget-button {
  128. display: inline-block;
  129. }
  130. }
  131. }
  132. p.buttons.wcppec-cart-widget-spb {
  133. padding: 0;
  134. }
  135. }
  136. ul.cart_list li a,
  137. ul.product_list_widget li a {
  138. padding: 0;
  139. }
  140. ul.cart_list li .quantity,
  141. ul.product_list_widget li .quantity,
  142. ul.cart_list li a:not(.remove),
  143. ul.product_list_widget li a:not(.remove),
  144. .woocommerce-mini-cart__total {
  145. @include font-family( map-deep-get($config-header, "main-nav", "font", "family") );
  146. font-size: #{map-deep-get($config-global, "font", "size", "base")};
  147. }
  148. @include media(mobile) {
  149. & > div > ul > li.woocommerce-menu-item > .sub-menu {
  150. left: auto;
  151. right: 0;
  152. }
  153. .woocommerce-cart-widget {
  154. max-width: #{map-deep-get($config-woocommerce, "mini-cart", "width")};
  155. }
  156. & > div > ul > li.woocommerce-menu-item:hover > ul:before,
  157. & > div > ul > li.woocommerce-menu-item.focus > ul:before,
  158. & > div > ul > li.woocommerce-menu-item.current-menu-item > ul:before {
  159. margin-left: auto;
  160. margin-right: #{map-deep-get($config-global, "spacing", "unit")};
  161. }
  162. }
  163. }
  164. }
  165. .woocommerce-cart #page .woocommerce-menu-item .sub-menu,
  166. .woocommerce-checkout #page .woocommerce-menu-item .sub-menu {
  167. display: none;
  168. }