pleroma-fe/src/panel.scss

210 lines
4.3 KiB
SCSS
Raw Normal View History

2023-01-09 19:02:16 +01:00
/* stylelint-disable no-descending-specificity */
2022-04-05 16:15:30 +02:00
.panel {
--__panel-background: var(--background);
--__panel-backdrop-filter: var(--backdrop-filter);
2024-03-25 15:29:24 +01:00
.tab-switcher .tabs {
background: var(--__panel-background);
backdrop-filter: var(--__panel-backdrop-filter);
}
2022-04-05 16:15:30 +02:00
position: relative;
display: flex;
flex-direction: column;
.panel-heading {
background-color: inherit;
}
2022-04-05 16:15:30 +02:00
&::after,
& {
2024-02-13 01:09:43 +01:00
border-radius: var(--roundness);
2022-04-05 16:15:30 +02:00
}
&::after {
2023-01-09 19:02:16 +01:00
content: "";
2022-04-05 16:15:30 +02:00
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 5;
2024-02-11 22:11:28 +01:00
box-shadow: var(--shadow);
2022-04-05 16:15:30 +02:00
pointer-events: none;
}
}
2022-04-28 09:57:06 +02:00
.panel-body {
padding: var(--panel-body-padding, 0);
background: var(--background);
backdrop-filter: var(--__panel-backdrop-filter);
2022-04-28 09:57:06 +02:00
2024-03-25 15:29:24 +01:00
.tab-switcher .tabs {
background: none;
backdrop-filter: none;
}
2022-04-28 09:57:06 +02:00
&:empty::before {
content: "¯\\_(ツ)_/¯"; // Could use words but it'd require translations
display: block;
2024-03-06 23:28:16 +01:00
padding: 1em;
2022-04-28 09:57:06 +02:00
text-align: center;
}
> p {
line-height: 1.3;
padding: 1em;
margin: 0;
}
2022-04-05 16:15:30 +02:00
}
.panel-heading,
.panel-footer {
2022-04-10 21:37:08 +02:00
--panel-heading-height-padding: 0.6em;
2022-09-29 10:52:48 +02:00
--__panel-heading-gap: 0.5em;
--__panel-heading-height: 3.2em;
--__panel-heading-height-inner: calc(var(--__panel-heading-height) - 2 * var(--panel-heading-height-padding, 0));
2022-04-10 21:37:08 +02:00
backdrop-filter: var(--__panel-backdrop-filter);
2022-04-05 16:15:30 +02:00
position: relative;
box-sizing: border-box;
display: grid;
grid-auto-flow: column;
2022-04-20 23:39:54 +02:00
grid-template-columns: minmax(50%, 1fr);
grid-auto-columns: auto;
2022-09-29 10:52:48 +02:00
grid-column-gap: var(--__panel-heading-gap);
2022-04-05 16:15:30 +02:00
flex: none;
background-size: cover;
padding: var(--panel-heading-height-padding);
height: var(--__panel-heading-height);
line-height: var(--__panel-heading-height-inner);
z-index: 4;
2022-04-05 16:15:30 +02:00
&.-flexible-height {
2022-04-25 23:12:24 +02:00
--__panel-heading-height: auto;
2022-04-05 16:15:30 +02:00
&::after,
&::before {
display: none;
}
}
&.-stub {
&,
&::after {
2024-02-13 01:09:43 +01:00
border-radius: var(--roundness);
}
}
2022-04-05 16:15:30 +02:00
&.-sticky {
position: sticky;
2022-04-10 17:44:22 +02:00
top: var(--navbar-height);
2022-04-05 16:15:30 +02:00
}
&::after,
&::before {
2023-01-09 19:02:16 +01:00
content: "";
2022-04-05 16:15:30 +02:00
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
pointer-events: none;
}
.title {
font-size: 1.3em;
}
.alert {
white-space: nowrap;
text-overflow: ellipsis;
overflow-x: hidden;
}
&:not(.-flexible-height) {
> .button-default,
> .alert {
height: var(--__panel-heading-height-inner);
min-height: 0;
box-sizing: border-box;
margin: 0;
min-width: 1px;
padding-top: 0;
padding-bottom: 0;
align-self: stretch;
2022-04-05 16:15:30 +02:00
}
2024-02-28 13:25:22 +01:00
> .alert {
line-height: calc(var(--__panel-heading-height-inner) - 2px);
}
}
}
// TODO Should refactor panels into separate component and utilize slots
.panel-heading {
2024-02-13 01:09:43 +01:00
border-radius: var(--roundness) var(--roundness) 0 0;
2023-01-09 19:02:16 +01:00
border-width: 0 0 1px;
2022-04-28 15:36:53 +02:00
align-items: start;
background-image:
linear-gradient(to bottom, var(--background), var(--background)),
linear-gradient(to bottom, var(--__panel-background), var(--__panel-background));
2022-04-05 16:15:30 +02:00
&::after {
background-color: var(--background);
z-index: -2;
2024-03-25 16:02:36 +01:00
border-radius: var(--roundness) var(--roundness) 0 0;
2024-02-11 22:11:28 +01:00
box-shadow: var(--shadow);
2022-04-28 09:52:41 +02:00
}
&:not(.-flexible-height) {
> .button-default {
flex-shrink: 0;
2022-04-05 16:15:30 +02:00
}
}
.rightside-button {
align-self: stretch;
text-align: center;
width: var(--__panel-heading-height);
height: var(--__panel-heading-height);
margin: calc(-1 * var(--panel-heading-height-padding)) 0;
margin-right: calc(-1 * var(--__panel-heading-gap));
> button {
box-sizing: border-box;
padding: calc(1 * var(--panel-heading-height-padding)) 0;
height: 100%;
width: 100%;
text-align: center;
svg {
font-size: 1.2em;
}
}
}
.rightside-icon {
align-self: stretch;
text-align: center;
width: var(--__panel-heading-height);
margin-right: calc(-1 * var(--__panel-heading-gap));
svg {
font-size: 1.2em;
}
}
2022-04-05 16:15:30 +02:00
}
.panel-footer {
2024-02-13 01:09:43 +01:00
border-top-left-radius: 0;
border-top-right-radius: 0;
align-items: center;
2023-01-09 19:02:16 +01:00
border-width: 1px 0 0;
2022-04-05 16:15:30 +02:00
border-style: solid;
2024-02-11 22:11:28 +01:00
border-color: var(--border);
background-color: var(--__panel-background);
2022-04-05 16:15:30 +02:00
}
2023-01-09 19:02:16 +01:00
/* stylelint-enable no-descending-specificity */