_extends.scss 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. @mixin button-style {
  2. @include button-main-styles;
  3. @include button-hover-styles;
  4. }
  5. @mixin button-main-styles {
  6. @include crop-text(var(--button--line-height));
  7. color: var(--button--color-text);
  8. cursor: pointer;
  9. font-weight: var(--button--font-weight);
  10. font-family: var(--button--font-family);
  11. font-size: var(--button--font-size);
  12. background-color: var(--button--color-background);
  13. border-radius: var(--button--border-radius);
  14. border-width: 0;
  15. text-decoration: none;
  16. padding: var(--button--padding-vertical) var(--button--padding-horizontal);
  17. }
  18. @mixin button-hover-styles {
  19. &:not(.has-background) {
  20. &:active {
  21. color: var(--button--color-text-active);
  22. background-color: var(--button--color-background-active);
  23. }
  24. &:hover,
  25. &:focus,
  26. &.has-focus {
  27. color: var(--button--color-text-hover);
  28. background-color: var(--button--color-background-hover);
  29. }
  30. }
  31. }
  32. // Button Placeholder style
  33. // - Since buttons appear in various blocks,
  34. // let’s use a placeholder to keep them all
  35. // in-sync
  36. %button-style {
  37. @include button-style;
  38. }
  39. // Onsale Placeholder style
  40. // - Since buttons appear in various blocks,
  41. // let’s use a placeholder to keep them all
  42. // in-sync
  43. %onsale-style {
  44. border-radius: 100%;
  45. background-color: var(--global--color-alert-warning);
  46. color: var(--global--color-foreground-high-contrast);
  47. font-size: var(--global--font-size-sm);
  48. font-weight: 700;
  49. font-family: var(--global--font-primary);
  50. min-height: 3.236rem;
  51. min-width: 3.236rem;
  52. padding: 0.202rem;
  53. position: absolute;
  54. text-align: center;
  55. text-transform: none;
  56. line-height: 3.236;
  57. top: -0.5em;
  58. right: -0.5em;
  59. left: auto;
  60. margin: 0;
  61. z-index: 9;
  62. }