Skip to content

Commit a2263b6

Browse files
committed
refactor: run formatter
1 parent 9a64ef2 commit a2263b6

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

scss/_patterns_in-page-navigation.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
@mixin vf-p-in-page-navigation {
3636
// Use a consistent border width for left-highlight and list border
37-
$in-page-navigation-border-width: 3px;
37+
$in-page-navigation-border-width: 3px;
3838

3939
// Shares text styles
4040
%in-page-navigation__text {
@@ -61,14 +61,17 @@
6161

6262
// Scroll margins for headings withing the parent grid section
6363
.grid-row:has(.p-in-page-navigation) {
64-
h2, h3, h4 {
64+
h2,
65+
h3,
66+
h4 {
6567
scroll-margin-top: 72px;
6668

6769
@media screen and (width >= $threshold-4-8-col) {
6870
scroll-margin-top: 24px;
6971
}
7072

71-
@at-root body:has(.p-navigation.is-sticky) &, body:has(.p-navigation--sliding.is-sticky) & {
73+
@at-root body:has(.p-navigation.is-sticky) &,
74+
body:has(.p-navigation--sliding.is-sticky) & {
7275
scroll-margin-top: 120px;
7376

7477
@media screen and (width >= $threshold-4-8-col) {
@@ -278,7 +281,7 @@
278281
left: 50%;
279282
position: absolute;
280283
transform: translateX(-50%);
281-
width: 100%
284+
width: 100%;
282285
}
283286
}
284287

@@ -363,7 +366,7 @@
363366
}
364367

365368
// Small/medium screens - collapsed dropdown
366-
.p-in-page-navigation__container:has(> .p-in-page-navigation__list:not([aria-expanded='true'])) {
369+
.p-in-page-navigation__container:has(> .p-in-page-navigation__list:not([aria-expanded='true'])) {
367370
@media screen and (width < $threshold-4-8-col) {
368371
.p-in-page-navigation__list {
369372
grid-column: 1;

templates/docs/examples/patterns/in-page-navigation/_in-page-navigation.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function initNavigationInteraction(navRoot) {
147147
// Prevent recreating the observer if state hasn't changed
148148
if (lastViewportState === isLargeView) {
149149
return;
150-
}
150+
}
151151
lastViewportState = isLargeView;
152152

153153
// Cleanup existing observer
@@ -167,7 +167,7 @@ function initNavigationInteraction(navRoot) {
167167
{
168168
rootMargin: isLargeView ? '-10% 0px -50% 0px' : '-10% 0px -75% 0px',
169169
threshold: 0.5,
170-
}
170+
},
171171
);
172172

173173
headings.forEach((heading) => observer.observe(heading));
@@ -197,14 +197,16 @@ function initNavigationInteraction(navRoot) {
197197
const targetHeading = document.querySelector(targetId);
198198
if (targetHeading) {
199199
targetHeading.setAttribute('tabindex', '-1');
200-
targetHeading.focus({ preventScroll: true });
201-
targetHeading.scrollIntoView({ behavior: 'smooth' });
200+
targetHeading.focus({preventScroll: true});
201+
targetHeading.scrollIntoView({behavior: 'smooth'});
202202
history.pushState(null, null, targetId);
203203
}
204204
// We use a timeout to prevent the IntersectionObserver from immediately
205205
// overiding the active state. As the IntersectionObserver points at the
206206
// center of the screen
207-
setTimeout(() => {navItemClicked = false;}, 1000);
207+
setTimeout(() => {
208+
navItemClicked = false;
209+
}, 1000);
208210
});
209211
});
210212

@@ -373,11 +375,7 @@ function scrollActiveNavItemIntoView(link) {
373375
* @returns {number} The width of the viewport in pixels
374376
*/
375377
function getCurrentViewportWidth() {
376-
return Math.max(
377-
document.documentElement.clientWidth ||
378-
0, window.innerWidth ||
379-
0
380-
);
378+
return Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
381379
}
382380

383381
/**
@@ -393,4 +391,4 @@ function debounce(func, wait) {
393391
clearTimeout(timeout);
394392
timeout = setTimeout(() => func.apply(context, args), wait);
395393
};
396-
}
394+
}

0 commit comments

Comments
 (0)