@salesforcedevs/docs-components 1.3.106-alpha.3 → 1.3.106-alpha.5

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.3",
3
+ "version": "1.3.106-alpha.5",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -210,32 +210,34 @@ export default class ContentLayout extends LightningElement {
210
210
  return;
211
211
  }
212
212
 
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
- );
225
-
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`
213
+ // sync with the browser to account for any reflows that may have happened
214
+ requestAnimationFrame(() => {
215
+ const globalNavHeight =
216
+ globalNavEl.offsetHeight + contextNavEl.offsetHeight;
217
+ const docHeaderHeight = docHeaderEl.offsetHeight;
218
+ sidebarEl.style.setProperty(
219
+ "--dx-c-content-sidebar-sticky-top",
220
+ `${globalNavHeight + docHeaderHeight}px`
237
221
  );
238
- }
222
+ docHeaderEl.style.setProperty(
223
+ "--dx-g-global-header-height",
224
+ `${globalNavHeight}px`
225
+ );
226
+
227
+ // If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).
228
+ if (docPhaseEl) {
229
+ docPhaseEl.style.setProperty(
230
+ "--doc-c-phase-top",
231
+ `${
232
+ window.innerWidth < 769
233
+ ? globalNavHeight +
234
+ docHeaderHeight +
235
+ sidebarEl.offsetHeight
236
+ : globalNavHeight + docHeaderHeight
237
+ }px`
238
+ );
239
+ }
240
+ });
239
241
  };
240
242
 
241
243
  updateHighlighted = (event: Event): void =>
@@ -87,6 +87,7 @@ header:not(.has-brand) > .header_l2 {
87
87
  margin-right: 0;
88
88
  padding: var(--dx-g-spacing-smd)
89
89
  var(--dx-g-global-header-padding-horizontal);
90
+ height: var(--dx-g-doc-header-main-nav-height);
90
91
  }
91
92
 
92
93
  .header_l2_group-title .header_lang-dropdown {
@@ -8,7 +8,7 @@ import { track } from "dxUtils/analytics";
8
8
 
9
9
  const TABLET_MATCH = "980px";
10
10
  const MOBILE_MATCH = "880px";
11
- const SMALL_MOBILE_MATCH = "740px";
11
+ const SMALL_MOBILE_MATCH = "768px";
12
12
 
13
13
  export default class Header extends HeaderBase {
14
14
  @api langValuePath: string = "id"; // allows to override how language property is interpreted, follows valuePath dropdown api.