Nav apraksta

style.scss 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. .wc-block-link-button {
  2. @include link-button();
  3. }
  4. .wc-block-suspense-placeholder {
  5. @include placeholder();
  6. @include force-content();
  7. }
  8. // These styles are for the server side rendered product grid blocks.
  9. .wc-block-grid__products .wc-block-grid__product-image {
  10. text-decoration: none;
  11. display: block;
  12. position: relative;
  13. a {
  14. text-decoration: none;
  15. border: 0;
  16. outline: 0;
  17. box-shadow: none;
  18. }
  19. img {
  20. height: auto;
  21. width: 100%;
  22. &[hidden] {
  23. display: none;
  24. }
  25. }
  26. }
  27. .edit-post-visual-editor .editor-block-list__block .wc-block-grid__product-title,
  28. .editor-styles-wrapper .wc-block-grid__product-title,
  29. .wc-block-grid__product-title {
  30. font-family: inherit;
  31. line-height: 1.2em;
  32. font-weight: 700;
  33. padding: 0;
  34. color: inherit;
  35. font-size: inherit;
  36. display: block;
  37. }
  38. .wc-block-grid__product-price {
  39. display: block;
  40. .wc-block-grid__product-price__regular {
  41. margin-right: 0.5em;
  42. }
  43. }
  44. .wc-block-grid__product-add-to-cart.wp-block-button {
  45. word-break: break-word;
  46. white-space: normal;
  47. .wp-block-button__link {
  48. word-break: break-word;
  49. white-space: normal;
  50. margin: 0 auto !important;
  51. display: inline-flex;
  52. justify-content: center;
  53. text-align: center;
  54. // Set button font size and padding so it inherits from parent.
  55. padding: 0.5em 1em;
  56. font-size: 1em;
  57. &.loading {
  58. opacity: 0.25;
  59. }
  60. &.added::after {
  61. font-family: WooCommerce; /* stylelint-disable-line */
  62. content: "\e017";
  63. margin-left: 0.5em;
  64. display: inline-block;
  65. width: auto;
  66. height: auto;
  67. }
  68. &.loading::after {
  69. font-family: WooCommerce; /* stylelint-disable-line */
  70. content: "\e031";
  71. animation: spin 2s linear infinite;
  72. margin-left: 0.5em;
  73. display: inline-block;
  74. width: auto;
  75. height: auto;
  76. }
  77. }
  78. }
  79. // Remove button sugar if unlikely to fit.
  80. .has-5-columns:not(.alignfull),
  81. .has-6-columns,
  82. .has-7-columns,
  83. .has-8-columns,
  84. .has-9-columns {
  85. .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link::after {
  86. content: "";
  87. margin: 0;
  88. }
  89. }
  90. .wc-block-grid__product-rating {
  91. display: block;
  92. .wc-block-grid__product-rating__stars,
  93. .star-rating {
  94. overflow: hidden;
  95. position: relative;
  96. width: 5.3em;
  97. height: 1.618em;
  98. line-height: 1.618;
  99. font-size: 1em;
  100. /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
  101. font-family: star;
  102. font-weight: 400;
  103. margin: 0 auto;
  104. text-align: left;
  105. &::before {
  106. content: "\53\53\53\53\53";
  107. top: 0;
  108. left: 0;
  109. right: 0;
  110. position: absolute;
  111. opacity: 0.5;
  112. color: #aaa;
  113. white-space: nowrap;
  114. }
  115. span {
  116. overflow: hidden;
  117. top: 0;
  118. left: 0;
  119. right: 0;
  120. position: absolute;
  121. padding-top: 1.5em;
  122. }
  123. span::before {
  124. content: "\53\53\53\53\53";
  125. top: 0;
  126. left: 0;
  127. right: 0;
  128. position: absolute;
  129. color: #000;
  130. white-space: nowrap;
  131. }
  132. }
  133. }
  134. .wc-block-grid__product-onsale {
  135. @include font-size(small);
  136. padding: em($gap-smallest) em($gap-small);
  137. display: inline-block;
  138. width: auto;
  139. border: 1px solid #43454b;
  140. border-radius: 3px;
  141. color: #43454b;
  142. background: #fff;
  143. text-align: center;
  144. text-transform: uppercase;
  145. font-weight: 600;
  146. z-index: 9;
  147. position: relative;
  148. }
  149. // Element spacing.
  150. .wc-block-grid__product {
  151. .wc-block-grid__product-image,
  152. .wc-block-grid__product-title {
  153. margin: 0 0 $gap-small;
  154. }
  155. // If centered when toggling alignment on, use auto margins to prevent flexbox stretching it.
  156. .wc-block-grid__product-price,
  157. .wc-block-grid__product-rating,
  158. .wc-block-grid__product-add-to-cart,
  159. .wc-block-grid__product-onsale {
  160. margin: 0 auto $gap-small;
  161. }
  162. }
  163. .theme-twentysixteen {
  164. .wc-block-grid {
  165. // Prevent white theme styles.
  166. .price ins {
  167. color: #77a464;
  168. }
  169. }
  170. }
  171. .theme-twentynineteen {
  172. .wc-block-grid__product {
  173. font-size: 0.88889em;
  174. }
  175. // Change the title font to match headings.
  176. .wc-block-grid__product-title,
  177. .wc-block-grid__product-onsale,
  178. .wc-block-components-product-title,
  179. .wc-block-components-product-sale-badge {
  180. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  181. }
  182. .wc-block-grid__product-title::before {
  183. display: none;
  184. }
  185. .wc-block-grid__product-onsale,
  186. .wc-block-components-product-sale-badge {
  187. line-height: 1;
  188. }
  189. .editor-styles-wrapper .wp-block-button .wp-block-button__link:not(.has-text-color) {
  190. color: #fff;
  191. }
  192. }
  193. .theme-twentytwenty {
  194. $twentytwenty-headings: -apple-system, blinkmacsystemfont, "Helvetica Neue", helvetica, sans-serif;
  195. $twentytwenty-highlights-color: #cd2653;
  196. .wc-block-grid__product-link {
  197. color: #000;
  198. }
  199. .wc-block-grid__product-title,
  200. .wc-block-components-product-title {
  201. font-family: $twentytwenty-headings;
  202. color: #000;
  203. font-size: 1.2em;
  204. }
  205. .wp-block-columns .wc-block-components-product-title {
  206. margin-top: 0;
  207. }
  208. .wc-block-grid__product-price,
  209. .wc-block-components-product-price {
  210. &__value,
  211. .woocommerce-Price-amount {
  212. font-family: $twentytwenty-headings;
  213. font-size: 0.9em;
  214. }
  215. del {
  216. opacity: 0.5;
  217. }
  218. ins {
  219. text-decoration: none;
  220. }
  221. }
  222. .wc-block-grid__product-rating,
  223. .star-rating {
  224. font-size: 0.7em;
  225. .wc-block-grid__product-rating__stars,
  226. .wc-block-components-product-rating__stars {
  227. line-height: 1;
  228. }
  229. }
  230. .wc-block-grid__product-add-to-cart > .wp-block-button__link,
  231. .wc-block-components-product-button > .wp-block-button__link {
  232. font-family: $twentytwenty-headings;
  233. }
  234. .wc-block-grid__products .wc-block-grid__product-onsale,
  235. .wc-block-components-product-sale-badge {
  236. background: $twentytwenty-highlights-color;
  237. color: #fff;
  238. font-family: $twentytwenty-headings;
  239. font-weight: 700;
  240. letter-spacing: -0.02em;
  241. line-height: 1.2;
  242. text-transform: uppercase;
  243. }
  244. // Override style from WC Core that set its position to absolute.
  245. // These rulesets can be removed once https://github.com/woocommerce/woocommerce/pull/26516 is released.
  246. .wc-block-grid__products .wc-block-components-product-sale-badge {
  247. position: static;
  248. }
  249. .wc-block-grid__products .wc-block-grid__product-image .wc-block-components-product-sale-badge {
  250. position: absolute;
  251. }
  252. // These styles are not applied to the All Products atomic block, so it can be positioned normally.
  253. .wc-block-grid__products .wc-block-grid__product-onsale:not(.wc-block-components-product-sale-badge) {
  254. position: absolute;
  255. right: 4px;
  256. top: 4px;
  257. z-index: 1;
  258. }
  259. @media only screen and (min-width: 768px) {
  260. .wc-block-grid__products .wc-block-grid__product-onsale {
  261. @include font-size(small);
  262. padding: em($gap-smaller);
  263. }
  264. }
  265. @media only screen and (min-width: 1168px) {
  266. .wc-block-grid__products .wc-block-grid__product-onsale {
  267. @include font-size(small);
  268. padding: em($gap-smaller);
  269. }
  270. }
  271. }
  272. // Default screen-reader styles. Included as a fallback for themes that don't have support.
  273. .screen-reader-text {
  274. @include visually-hidden();
  275. }
  276. .screen-reader-text:focus {
  277. @include visually-hidden-focus-reveal();
  278. }