_panel.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. $header-icon-size: theme('spacing.4');
  2. $header-button-size-mobile: $mobile-nice-padding;
  3. $header-button-size: theme('spacing.8');
  4. $header-gap: theme('spacing.1');
  5. .w-panel {
  6. margin-bottom: theme('spacing.10');
  7. .content-locked &__content {
  8. cursor: not-allowed;
  9. user-select: none;
  10. > * {
  11. pointer-events: none;
  12. }
  13. }
  14. }
  15. .w-panel__header {
  16. display: flex;
  17. align-items: center;
  18. margin-bottom: theme('spacing.[0.5]');
  19. margin-inline-start: -1 * $mobile-nice-padding;
  20. @include media-breakpoint-up(sm) {
  21. gap: $header-gap;
  22. margin-inline-start: calc(-1 * 1 * ($header-button-size + $header-gap));
  23. }
  24. @include media-breakpoint-up(md) {
  25. margin-inline-start: calc(-1 * 2 * ($header-button-size + $header-gap));
  26. }
  27. }
  28. .w-panel__heading {
  29. @apply w-h3;
  30. display: inline-block;
  31. margin: 0;
  32. white-space: nowrap;
  33. text-overflow: ellipsis;
  34. cursor: pointer;
  35. padding-inline-end: theme('spacing.2');
  36. label {
  37. cursor: pointer;
  38. }
  39. @include media-breakpoint-up(md) {
  40. padding-inline-end: theme('spacing.5');
  41. }
  42. }
  43. .w-panel__heading--label {
  44. @apply w-label-1;
  45. }
  46. .w-panel__anchor,
  47. .w-panel__toggle,
  48. .w-panel__controls .button.button--icon {
  49. @include show-focus-outline-inside();
  50. display: inline-grid;
  51. justify-content: center;
  52. align-content: center;
  53. color: theme('colors.primary.DEFAULT');
  54. border-radius: theme('borderRadius.full');
  55. margin: 0;
  56. padding: 0;
  57. width: $header-button-size-mobile;
  58. height: $header-button-size-mobile;
  59. &:focus-visible,
  60. &:hover {
  61. background-color: $color-grey-5;
  62. @media (forced-colors: active) {
  63. border: 1px solid currentColor;
  64. }
  65. }
  66. &[disabled] {
  67. color: $color-grey-3;
  68. cursor: not-allowed;
  69. // Counter hover styles.
  70. background-color: transparent;
  71. @media (forced-colors: active) {
  72. color: GrayText;
  73. }
  74. }
  75. @include media-breakpoint-up(sm) {
  76. width: $header-button-size;
  77. height: $header-button-size;
  78. }
  79. }
  80. .w-panel__anchor {
  81. // Only hide anchors for devices that support hover interactions.
  82. @media (hover: hover) {
  83. .w-panel__header:not(:hover, :focus-within) & {
  84. opacity: 0;
  85. }
  86. }
  87. }
  88. // The suffix anchor is intended for small viewports only.
  89. .w-panel__anchor--suffix {
  90. @include media-breakpoint-up(md) {
  91. display: none;
  92. }
  93. }
  94. // The prefix anchor can be used when there is enough space in the margin of the page.
  95. .w-panel__anchor--prefix {
  96. display: none;
  97. @include media-breakpoint-up(md) {
  98. display: inline-grid;
  99. }
  100. }
  101. .w-panel__toggle {
  102. appearance: none;
  103. background: transparent;
  104. }
  105. .w-panel__icon {
  106. width: $header-icon-size;
  107. height: $header-icon-size;
  108. // Only rotate the default caret icon, not custom ones.
  109. [aria-expanded='false'] &.icon-arrow-down-big {
  110. transform: rotate(-90deg);
  111. }
  112. &.icon-link {
  113. width: theme('spacing.[3.5]');
  114. height: theme('spacing.[3.5]');
  115. }
  116. }
  117. .w-panel__divider {
  118. flex: 1;
  119. }
  120. .w-panel__controls {
  121. // Prevent shrinking of the buttons when header text is long.
  122. flex-shrink: 0;
  123. // Add additional invisible padding for a more forgiving hover area.
  124. padding: theme('spacing.4');
  125. margin: calc(-1 * theme('spacing.4'));
  126. margin-inline-end: calc(-1 * theme('spacing.8'));
  127. margin-inline-start: 0;
  128. @include media-breakpoint-up(sm) {
  129. margin: calc(-1 * theme('spacing.4'));
  130. margin-inline-start: 0;
  131. }
  132. }
  133. .w-panel__wrapper {
  134. @include max-form-width();
  135. }