Skip to content

Commit 63beff0

Browse files
committed
Allow positioning backdrop below navigation bar
Introduce --widget-margin-top-min and --widget-margin-top-max CSS variables that widgets can set to indicate how much space they occupy at the top of the viewport. Use these to offset sticky backdrops and adjust full height sections accordingly. REDMINE-21204
1 parent f3331ea commit 63beff0

10 files changed

Lines changed: 20 additions & 13 deletions

entry_types/scrolled/package/src/frontend/Foreground.module.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
flex-direction: column;
1111
justify-content: center;
1212

13-
padding-top: calc(var(--foreground-widget-padding-top) + var(--foreground-padding-top));
13+
padding-top: calc(var(--foreground-widget-padding-top, 0px) + var(--foreground-padding-top));
1414
padding-bottom: var(--foreground-padding-bottom);
1515
}
1616

@@ -19,7 +19,13 @@
1919
}
2020

2121
.fullHeight {
22-
min-height: 100vh;
22+
/* First sections set --foreground-widget-padding-top to make room
23+
for the widget, so the terms cancel out to 100vh. Other sections
24+
leave it undefined, causing the fallback to --widget-margin-top-min
25+
to reduce the height to fit below the navigation widget. */
26+
min-height: calc(100vh +
27+
var(--foreground-widget-padding-top, 0px) -
28+
var(--foreground-widget-padding-top, var(--widget-margin-top-min, 0px)));
2329
}
2430

2531
.spaceAbove {

entry_types/scrolled/package/src/frontend/Fullscreen.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.root {
22
width: 100%;
3-
height: calc(100 * var(--vh));
3+
height: calc((100 * var(--vh)) - var(--widget-margin-top-min, 0px));
44
position: relative;
55
overflow: clip;
66
}

entry_types/scrolled/package/src/frontend/Section.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
--centered-inline-xl-content-max-width:
3636
var(--theme-centered-inline-xl-content-max-width);
3737

38-
--foreground-widget-padding-top: 0px;
3938
--foreground-padding-top: var(--theme-section-default-padding-top);
4039
--foreground-padding-bottom: var(--theme-section-default-padding-bottom);
4140
}
4241

4342
.first {
4443
/* Let content begin below navigation bar. Navigation bar has zero
4544
height to let first chapter start at the very top. */
46-
--foreground-widget-padding-top: var(--theme-widget-margin-top, 58px);
45+
--foreground-widget-padding-top: var(--widget-margin-top-max,
46+
var(--theme-widget-margin-top, 0px));
4747
}
4848

4949
.narrow {

entry_types/scrolled/package/src/frontend/inlineEditing/PaddingIndicator.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
.indicator-top {
3838
composes: indicator;
39-
top: var(--foreground-widget-padding-top);
39+
top: var(--foreground-widget-padding-top, 0px);
4040
height: var(--foreground-padding-top, space(12));
4141
}
4242

entry_types/scrolled/package/src/frontend/inlineEditing/SectionDecorator.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ section::before {
66
content: "";
77
display: block;
88
position: absolute;
9-
top: calc(6px + var(--foreground-widget-padding-top));
9+
top: calc(6px + var(--foreground-widget-padding-top, 0px));
1010
left: 6px;
1111
right: 6px;
1212
bottom: 6px;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.backdrop {
22
position: sticky;
3-
top: 0;
3+
top: var(--widget-margin-top-min, 0px);
44
height: 0;
55
}

entry_types/scrolled/package/src/frontend/transitions/scrollInFadeOut.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.backdrop {
44
position: sticky;
5-
top: 0;
5+
top: var(--widget-margin-top-min, 0px);
66
height: 0;
77
}
88

entry_types/scrolled/package/src/frontend/transitions/scrollInFadeOutBg.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.backdrop {
44
position: sticky;
5-
top: 0;
5+
top: var(--widget-margin-top-min, 0px);
66
height: 0;
77
}
88

entry_types/scrolled/package/src/frontend/transitions/scrollInScrollOut.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
.backdropInner {
88
position: sticky;
9-
top: 0;
10-
height: calc(100 * var(--vh));
9+
top: var(--widget-margin-top-min, 0px);
10+
height: calc((100 * var(--vh)) - var(--widget-margin-top-min, 0px));
1111
}

entry_types/scrolled/package/src/frontend/transitions/shared.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.fixed {
22
position: fixed;
3-
top: var(--fixed-positioning-containing-block-offset, 0);
3+
top: calc(var(--fixed-positioning-containing-block-offset, 0px) +
4+
var(--widget-margin-top-min, 0px));
45
height: 100vh;
56
width: 100%;
67
}

0 commit comments

Comments
 (0)