panel.scss 5.2 KB

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