panel.scss 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. /* stylelint-disable no-descending-specificity */
  2. .panel {
  3. position: relative;
  4. display: flex;
  5. flex-direction: column;
  6. background-color: $fallback--bg;
  7. background-color: var(--bg, $fallback--bg);
  8. &::after,
  9. & {
  10. border-radius: $fallback--panelRadius;
  11. border-radius: var(--panelRadius, $fallback--panelRadius);
  12. }
  13. &::after {
  14. content: "";
  15. position: absolute;
  16. top: 0;
  17. bottom: 0;
  18. left: 0;
  19. right: 0;
  20. z-index: 5;
  21. box-shadow: 1px 1px 4px rgb(0 0 0 / 60%);
  22. box-shadow: var(--panelShadow);
  23. pointer-events: none;
  24. }
  25. }
  26. .panel-body {
  27. padding: var(--panel-body-padding, 0);
  28. &:empty::before {
  29. content: "¯\\_(ツ)_/¯"; // Could use words but it'd require translations
  30. display: block;
  31. margin: 1em;
  32. text-align: center;
  33. }
  34. > p {
  35. line-height: 1.3;
  36. padding: 1em;
  37. margin: 0;
  38. }
  39. }
  40. .panel-heading,
  41. .panel-footer {
  42. --panel-heading-height-padding: 0.6em;
  43. --__panel-heading-gap: 0.5em;
  44. --__panel-heading-height: 3.2em;
  45. --__panel-heading-height-inner: calc(var(--__panel-heading-height) - 2 * var(--panel-heading-height-padding, 0));
  46. position: relative;
  47. box-sizing: border-box;
  48. display: grid;
  49. grid-auto-flow: column;
  50. grid-template-columns: minmax(50%, 1fr);
  51. grid-auto-columns: auto;
  52. grid-column-gap: var(--__panel-heading-gap);
  53. flex: none;
  54. background-size: cover;
  55. padding: var(--panel-heading-height-padding);
  56. height: var(--__panel-heading-height);
  57. line-height: var(--__panel-heading-height-inner);
  58. z-index: 4;
  59. &.-flexible-height {
  60. --__panel-heading-height: auto;
  61. &::after,
  62. &::before {
  63. display: none;
  64. }
  65. }
  66. &.-stub {
  67. &,
  68. &::after {
  69. border-radius: $fallback--panelRadius;
  70. border-radius: var(--panelRadius, $fallback--panelRadius);
  71. }
  72. }
  73. &.-sticky {
  74. position: sticky;
  75. top: var(--navbar-height);
  76. }
  77. &::after,
  78. &::before {
  79. content: "";
  80. position: absolute;
  81. top: 0;
  82. bottom: 0;
  83. right: 0;
  84. left: 0;
  85. pointer-events: none;
  86. }
  87. .title {
  88. font-size: 1.3em;
  89. }
  90. .alert {
  91. white-space: nowrap;
  92. text-overflow: ellipsis;
  93. overflow-x: hidden;
  94. }
  95. &:not(.-flexible-height) {
  96. > .button-default,
  97. > .alert {
  98. height: var(--__panel-heading-height-inner);
  99. min-height: 0;
  100. box-sizing: border-box;
  101. margin: 0;
  102. min-width: 1px;
  103. padding-top: 0;
  104. padding-bottom: 0;
  105. align-self: stretch;
  106. }
  107. }
  108. }
  109. // TODO Should refactor panels into separate component and utilize slots
  110. .panel-heading {
  111. border-radius: $fallback--panelRadius $fallback--panelRadius 0 0;
  112. border-radius: var(--panelRadius, $fallback--panelRadius) var(--panelRadius, $fallback--panelRadius) 0 0;
  113. border-width: 0 0 1px;
  114. align-items: start;
  115. // panel theme
  116. color: var(--panelText);
  117. background-color: $fallback--bg;
  118. background-color: var(--bg, $fallback--bg);
  119. &::after {
  120. background-color: $fallback--fg;
  121. background-color: var(--panel, $fallback--fg);
  122. z-index: -2;
  123. border-radius: $fallback--panelRadius $fallback--panelRadius 0 0;
  124. border-radius: var(--panelRadius, $fallback--panelRadius) var(--panelRadius, $fallback--panelRadius) 0 0;
  125. box-shadow: var(--panelHeaderShadow);
  126. }
  127. a,
  128. .-link {
  129. color: $fallback--link;
  130. color: var(--panelLink, $fallback--link);
  131. }
  132. .button-unstyled:hover,
  133. a:hover {
  134. i[class*="icon-"],
  135. .svg-inline--fa,
  136. .iconLetter {
  137. color: var(--panelText);
  138. }
  139. }
  140. .faint {
  141. background-color: transparent;
  142. color: $fallback--faint;
  143. color: var(--panelFaint, $fallback--faint);
  144. }
  145. .faint-link {
  146. color: $fallback--faint;
  147. color: var(--faintLink, $fallback--faint);
  148. }
  149. &:not(.-flexible-height) {
  150. > .button-default {
  151. flex-shrink: 0;
  152. &,
  153. i[class*="icon-"] {
  154. color: $fallback--text;
  155. color: var(--btnPanelText, $fallback--text);
  156. }
  157. &:active {
  158. background-color: $fallback--fg;
  159. background-color: var(--btnPressedPanel, $fallback--fg);
  160. color: $fallback--text;
  161. color: var(--btnPressedPanelText, $fallback--text);
  162. }
  163. &:disabled {
  164. color: $fallback--text;
  165. color: var(--btnDisabledPanelText, $fallback--text);
  166. }
  167. &.toggled {
  168. color: $fallback--text;
  169. color: var(--btnToggledPanelText, $fallback--text);
  170. }
  171. }
  172. }
  173. .rightside-button {
  174. align-self: stretch;
  175. text-align: center;
  176. width: var(--__panel-heading-height);
  177. height: var(--__panel-heading-height);
  178. margin: calc(-1 * var(--panel-heading-height-padding)) 0;
  179. margin-right: calc(-1 * var(--__panel-heading-gap));
  180. > button {
  181. box-sizing: border-box;
  182. padding: calc(1 * var(--panel-heading-height-padding)) 0;
  183. height: 100%;
  184. width: 100%;
  185. text-align: center;
  186. svg {
  187. font-size: 1.2em;
  188. }
  189. }
  190. }
  191. .rightside-icon {
  192. align-self: stretch;
  193. text-align: center;
  194. width: var(--__panel-heading-height);
  195. margin-right: calc(-1 * var(--__panel-heading-gap));
  196. svg {
  197. font-size: 1.2em;
  198. }
  199. }
  200. }
  201. .panel-footer {
  202. border-radius: 0 0 $fallback--panelRadius $fallback--panelRadius;
  203. border-radius: 0 0 var(--panelRadius, $fallback--panelRadius) var(--panelRadius, $fallback--panelRadius);
  204. align-items: center;
  205. border-width: 1px 0 0;
  206. border-style: solid;
  207. border-color: var(--border, $fallback--border);
  208. }
  209. /* stylelint-enable no-descending-specificity */