tabs.ts
resetTabGroupCounter
function
Reset tab group counter (for testing).
export function resetTabGroupCounter(): void
Returns
void -
getAttribute
function
Get element attribute value.
function getAttribute(el: Element, name: string): string | undefined
Returns
string | undefined -
parseTabChildren
function
Parse Tab elements from Tabs children.
function parseTabChildren(children: Element["children"]): TabData[]
Returns
TabData[] -
createTabsElement
function
Create the HTML structure for tabs.
function createTabsElement(tabs: TabData[], groupId: string): Element
Returns
Element -
createFallbackElement
function
Create fallback HTML using <details> elements.
function createFallbackElement(tabs: TabData[]): Element
Returns
Element -
rehypeTabs
function
Rehype plugin to transform Tabs components.
function rehypeTabs()
transformTabs
function
Transform Tabs components in HTML.
export async function transformTabs(html: string): Promise<string>
Returns
Promise<string> -
generateTabsCSS
function
Generate dynamic CSS for :has() based tab switching. This is needed because :has() selectors need unique IDs.
export function generateTabsCSS(groupCount: number): string
Returns
string -