Skip to content

Commit 1337735

Browse files
committed
adjust offset for glow effect around active tab
1 parent b702763 commit 1337735

File tree

1 file changed

+5
-1
lines changed
  • packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/CodeTabs

1 file changed

+5
-1
lines changed

packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/CodeTabs/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ function TabList({
5959
const activeTabRect = activeTab.getBoundingClientRect();
6060

6161
// Calculate the distance to scroll to align active tab to the left
62+
const glowOffset = 3;
6263
const scrollOffset =
63-
activeTabRect.left - containerRect.left + container.scrollLeft;
64+
activeTabRect.left -
65+
containerRect.left +
66+
container.scrollLeft -
67+
glowOffset;
6468

6569
// Check if the active tab is not already at the left position
6670

0 commit comments

Comments
 (0)