feat(analytics-docs): Add highlighting on window open

This commit is contained in:
Jan Václavík
2026-02-18 15:33:16 +01:00
parent f2883ae53b
commit ef94748a94
4 changed files with 5 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Analytics docs</title>
<title>Analytics events docs</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
:root {

View File

@@ -191,6 +191,8 @@ export const App = ({ theme }: AppProps) => {
if (!el) return false;
el.scrollIntoView({ block: 'start', behavior: 'instant' });
window.scrollBy(0, -(HEADER_HEIGHT + 20));
el.classList.add('highlighted');
setTimeout(() => el.classList.remove('highlighted'), HIGHLIGHT_DURATION_MS);
return true;
}, []);

View File

@@ -38,7 +38,7 @@ export const updateUrl = (
const search = params.toString();
const url = search ? `${window.location.pathname}?${search}` : window.location.pathname;
const {hash} = window.location;
const { hash } = window.location;
window.history.replaceState(null, '', `${url}${hash}`);
};

View File

@@ -78,7 +78,7 @@ export const Dropdown = forwardRef(
intent="neutral"
priority="secondary"
icon={iconName}
size={iconSize as ButtonSize}
size={iconSize}
tabIndex={-1}
isDisabled={isDisabled}
isLoading={isLoading}