2023-03-31 21:50:38 +00:00
|
|
|
|
$header-icon-size: theme('spacing.4');
|
|
|
|
|
$header-button-size-sm: theme('spacing.6');
|
|
|
|
|
$icon-center-offset: 2px;
|
|
|
|
|
$panel-bottom-margin: $form-field-spacing;
|
|
|
|
|
$guide-line-bottom-margin: calc($form-field-spacing / 3);
|
2022-08-12 12:17:40 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Panel styles shared between StreamField and InlinePanel,
|
|
|
|
|
* for repeating collapsible panels which can be reordered.
|
|
|
|
|
* Top-level and nested panels have guiding borders to show their start and end,
|
|
|
|
|
* as well as indentation for nested panels.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Styles for the top-level panel, and any panel within.
|
|
|
|
|
.w-panel--nested {
|
2023-03-31 21:50:38 +00:00
|
|
|
|
--nesting-indent: #{$nested-field-indent-sm};
|
|
|
|
|
|
|
|
|
|
@include media-breakpoint-up(sm) {
|
|
|
|
|
--nesting-indent: #{$nested-field-indent};
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-12 12:17:40 +00:00
|
|
|
|
.w-panel__content {
|
|
|
|
|
@include guide-line-vertical();
|
|
|
|
|
// Center the vertical line.
|
2023-03-31 21:50:38 +00:00
|
|
|
|
margin-inline-start: calc(-1 * var(--nesting-indent));
|
|
|
|
|
padding-inline-start: var(--nesting-indent);
|
|
|
|
|
margin-bottom: $guide-line-bottom-margin;
|
2022-08-12 12:17:40 +00:00
|
|
|
|
|
|
|
|
|
@include media-breakpoint-up(sm) {
|
2023-03-31 21:50:38 +00:00
|
|
|
|
// Extra pixels for better alignment with center of icon.
|
|
|
|
|
margin-inline-start: calc(
|
|
|
|
|
-1 * var(--nesting-indent) + $icon-center-offset
|
|
|
|
|
);
|
2022-08-12 12:17:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.w-panel__anchor {
|
|
|
|
|
// Mask the overlap with the parent panel’s guide line.
|
2023-04-19 05:58:14 +00:00
|
|
|
|
background-color: theme('colors.surface-page');
|
2022-08-12 12:17:40 +00:00
|
|
|
|
}
|
2023-03-31 21:50:38 +00:00
|
|
|
|
|
|
|
|
|
.w-field__wrapper {
|
|
|
|
|
// Reduced field spacing for nested panels.
|
|
|
|
|
// Using both padding and margin so the field guide line extends below.
|
|
|
|
|
padding-bottom: calc($form-field-spacing / 2);
|
|
|
|
|
margin-bottom: $guide-line-bottom-margin;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Styles for nested panels at the top level only.
|
|
|
|
|
.w-panel--nested:not(.w-panel .w-panel) {
|
|
|
|
|
> .w-panel__content {
|
|
|
|
|
@include guide-line-vertical-stop();
|
|
|
|
|
}
|
2022-08-12 12:17:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Styles for nested panels excluding the top level.
|
|
|
|
|
.w-panel--nested .w-panel {
|
|
|
|
|
@include guide-line-nested();
|
2023-03-31 21:50:38 +00:00
|
|
|
|
margin-inline-start: var(--nesting-indent);
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
|
|
|
|
.w-panel__content {
|
|
|
|
|
margin-inline-start: calc(
|
|
|
|
|
-1 * (var(--nesting-indent) + $icon-center-offset - var(--header-gap) / 2)
|
|
|
|
|
);
|
|
|
|
|
}
|
2022-08-12 12:17:40 +00:00
|
|
|
|
|
|
|
|
|
// Tighter spacing for nested panel headers so their icons align
|
|
|
|
|
// with parent panels’ guiding line.
|
|
|
|
|
.w-panel__header {
|
|
|
|
|
gap: 0;
|
2023-01-19 12:06:43 +00:00
|
|
|
|
transform: translateX(
|
2023-03-31 21:50:38 +00:00
|
|
|
|
calc(var(--w-direction-factor) * -1 * var(--nesting-indent))
|
2023-01-19 12:06:43 +00:00
|
|
|
|
);
|
2022-08-12 12:17:40 +00:00
|
|
|
|
|
|
|
|
|
@include media-breakpoint-up(sm) {
|
2023-01-19 12:06:43 +00:00
|
|
|
|
transform: translateX(
|
|
|
|
|
calc(var(--w-direction-factor) * theme('spacing.1'))
|
|
|
|
|
);
|
2022-08-12 12:17:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-31 21:51:39 +00:00
|
|
|
|
.w-panel__divider {
|
|
|
|
|
@include guide-line-horizontal();
|
|
|
|
|
// Slightly nicer text alignment.
|
|
|
|
|
margin-top: 1px;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-17 16:23:38 +00:00
|
|
|
|
.w-panel__heading--label {
|
|
|
|
|
// Use smaller labels within nested panels in InlinePanel.
|
|
|
|
|
@apply w-label-2;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-12 12:17:40 +00:00
|
|
|
|
// For nested panels, there is always enough space for the prefix anchor.
|
|
|
|
|
.w-panel__anchor--prefix {
|
|
|
|
|
display: inline-grid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Nested panels never need the suffix anchor.
|
|
|
|
|
.w-panel__anchor--suffix {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
}
|