@dbcdk/react-components 0.0.153 → 0.0.155

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,12 @@
10
10
  max-width: 100%;
11
11
  display: grid;
12
12
  gap: 0;
13
+
14
+ /* Banner height computed from its own tokens (not measured) — accurate for the
15
+ built-in EnvironmentBanner; off by the difference for a custom-height banner. */
16
+ --page-layout-banner-height: calc(
17
+ var(--spacing-2xs) * 2 + var(--font-size-md) * var(--line-height-normal)
18
+ );
13
19
  }
14
20
 
15
21
  /* Viewport handling:
@@ -44,14 +50,24 @@
44
50
  flex: 0 0 auto;
45
51
  }
46
52
 
47
- /* In contained mode, allocate banner height then give the rest to sidebar+main */
48
- .containScrolling.hasBanner {
53
+ /* Keep the banner visible while scrolling instead of it scrolling away; header and
54
+ sidebar stick right below it (see their top offsets further down). */
55
+ .documentScrolling .banner {
56
+ position: sticky;
57
+ top: 0;
58
+ z-index: calc(var(--z-sticky) + 1);
59
+ }
60
+
61
+ /* Give the banner its natural height, then the rest to the sidebar+main row (the
62
+ `1fr` row grows beyond it if content needs more — the CSS-grid sticky-footer trick). */
63
+ .hasBanner {
49
64
  grid-template-rows: auto 1fr;
50
65
  }
51
66
 
52
67
  /* Sidebar */
53
68
  .sidebar {
54
69
  min-width: 0;
70
+ min-block-size: 0; /* CRITICAL: else a tall sidenav grows the grid row instead of scrolling */
55
71
  overflow: hidden;
56
72
  background: var(--color-bg-surface);
57
73
  }
@@ -61,16 +77,33 @@
61
77
  -webkit-overflow-scrolling: touch;
62
78
  }
63
79
 
64
- /* In document-scrolling vertical layouts, keep the sidebar pinned to the viewport
65
- and let it manage its own scroll independently of body scrolling. */
80
+ /* Pin the sidebar to the viewport and let it scroll independently of the document.
81
+ max-block-size is a hard cap: a grid row's "auto" size still grows to fit a long
82
+ sidenav's content otherwise (min-block-size: 0 alone doesn't stop that). */
66
83
  .documentScrolling.vertical .sidebar {
67
84
  position: sticky;
68
85
  top: 0;
86
+ max-block-size: 100vh;
87
+ max-block-size: 100dvh;
88
+ overflow: auto;
89
+ -webkit-overflow-scrolling: touch;
90
+ }
91
+
92
+ /* Leave room for the banner's height, and stick below it instead of at top:0 so it
93
+ doesn't slide up underneath the now-sticky banner while scrolling. */
94
+ .documentScrolling.vertical.hasBanner .sidebar {
95
+ top: var(--page-layout-banner-height);
96
+ max-block-size: calc(100vh - var(--page-layout-banner-height));
97
+ max-block-size: calc(100dvh - var(--page-layout-banner-height));
98
+ }
99
+
100
+ /* Without a banner, the sidebar is the grid's only row (sizes to content, doesn't
101
+ stretch), so it needs an explicit height. With a banner, it stretches to fill the
102
+ `1fr` row instead (see .hasBanner above). */
103
+ .documentScrolling.vertical:not(.hasBanner) .sidebar {
69
104
  align-self: start;
70
105
  block-size: 100vh;
71
106
  block-size: 100dvh;
72
- overflow: auto;
73
- -webkit-overflow-scrolling: touch;
74
107
  }
75
108
 
76
109
  /* In horizontal orientation, sidebar becomes a top block if used */
@@ -113,6 +146,11 @@
113
146
  z-index: var(--z-sticky);
114
147
  }
115
148
 
149
+ /* Stick right below the (also sticky) banner instead of underneath it. */
150
+ .documentScrolling.hasBanner .header {
151
+ top: var(--page-layout-banner-height);
152
+ }
153
+
116
154
  .hero {
117
155
  min-width: 0;
118
156
  background: var(--color-bg-surface);
@@ -228,6 +228,8 @@ body.dbc-app {
228
228
  .dbc-highlight {
229
229
  color: var(--color-highlight-fg, inherit);
230
230
  background-color: var(--color-highlight-bg, var(--color-status-warning-bg));
231
+ font-family: inherit;
232
+ font-size: inherit;
231
233
  border-radius: var(--border-radius-sm);
232
234
  box-decoration-break: clone;
233
235
  -webkit-box-decoration-break: clone;
package/dist/styles.css CHANGED
@@ -228,6 +228,8 @@ body.dbc-app {
228
228
  .dbc-highlight {
229
229
  color: var(--color-highlight-fg, inherit);
230
230
  background-color: var(--color-highlight-bg, var(--color-status-warning-bg));
231
+ font-family: inherit;
232
+ font-size: inherit;
231
233
  border-radius: var(--border-radius-sm);
232
234
  box-decoration-break: clone;
233
235
  -webkit-box-decoration-break: clone;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbcdk/react-components",
3
- "version": "0.0.153",
3
+ "version": "0.0.155",
4
4
  "description": "Reusable React components for DBC projects",
5
5
  "license": "ISC",
6
6
  "author": "",