@salesforcedevs/docs-components 1.3.106-alpha.0 → 1.3.106-alpha.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.106-alpha.0",
3
+ "version": "1.3.106-alpha.2",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -185,6 +185,10 @@ export default class ContentLayout extends LightningElement {
185
185
  }
186
186
  };
187
187
 
188
+ /*
189
+ This is a workaround for the global nav sticky header being decoupled from the doc header & doc phase.
190
+ We have to account for the global nav changing height due to animations.
191
+ */
188
192
  adjustNavPosition = () => {
189
193
  const sidebarType = this.useOldSidebar
190
194
  ? "dx-sidebar-old"
@@ -196,19 +200,42 @@ export default class ContentLayout extends LightningElement {
196
200
  const contextNavEl = document.querySelector(
197
201
  "hgf-c360contextnav"
198
202
  ) as HTMLElement;
199
- const docHeaderEl = document.querySelector("doc-header") as HTMLElement;
203
+ const docHeaderEl = document.querySelector(
204
+ ".sticky-doc-header"
205
+ ) as HTMLElement;
206
+ const docPhaseEl = document.querySelector("doc-phase") as HTMLElement;
200
207
 
201
208
  if (!sidebarEl || !globalNavEl || !contextNavEl || !docHeaderEl) {
202
209
  console.warn("One or more required elements are missing.");
203
210
  return;
204
211
  }
205
212
 
206
- const totalOffsetHeight =
207
- globalNavEl.offsetHeight +
208
- contextNavEl.offsetHeight +
209
- docHeaderEl.offsetHeight;
213
+ const globalNavHeight =
214
+ globalNavEl.offsetHeight + contextNavEl.offsetHeight;
215
+ const docHeaderHeight = docHeaderEl.offsetHeight;
216
+
217
+ sidebarEl.style.setProperty(
218
+ "--dx-c-content-sidebar-sticky-top",
219
+ `${globalNavHeight + docHeaderHeight}px`
220
+ );
221
+ docHeaderEl.style.setProperty(
222
+ "--dx-g-global-header-height",
223
+ `${globalNavHeight}px`
224
+ );
210
225
 
211
- sidebarEl.style.top = `${totalOffsetHeight}px`;
226
+ // If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).
227
+ if (docPhaseEl) {
228
+ docPhaseEl.style.setProperty(
229
+ "--doc-c-phase-top",
230
+ `${
231
+ window.innerWidth <= 769
232
+ ? globalNavHeight +
233
+ docHeaderHeight +
234
+ sidebarEl.offsetHeight
235
+ : globalNavHeight + docHeaderHeight
236
+ }px`
237
+ );
238
+ }
212
239
  };
213
240
 
214
241
  updateHighlighted = (event: Event): void =>
@@ -84,6 +84,7 @@ header:not(.has-brand) > .header_l2 {
84
84
  }
85
85
 
86
86
  .header_l2_group-title {
87
+ height: var(--dx-g-doc-header-main-nav-height);
87
88
  margin-right: 0;
88
89
  padding: var(--dx-g-spacing-smd)
89
90
  var(--dx-g-global-header-padding-horizontal);