tabs.ts
6 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
Reference
fngenerateTabsCSS(groupCount: number): stringGenerate dynamic CSS for :has() based tab switching. This is needed because :ha…
Generate dynamic CSS for :has() based tab switching. This is needed because :has() selectors need unique IDs.
Signature
export function generateTabsCSS(groupCount: number): string
Parameters
-
groupCountnumber
Returns
string
fngetTabGroupCounter(): numberRead the shared tab group counter. Other tab-like transforms (such as the packa…
Read the shared tab group counter. Other tab-like transforms (such as the package-manager tabs) share this counter so data-group ids and the CSS generated by generateTabsCSS stay unique across a page.
Signature
export function getTabGroupCounter(): number
Returns
number
fnresetTabGroupCounter(): voidReset tab group counter (for testing and per dev-server request).
Reset tab group counter (for testing and per dev-server request).
Signature
export function resetTabGroupCounter(): void
Returns
void
fnsetTabGroupCounter(value: number): voidSet the shared tab group counter (advanced by other tab-like transforms).
Set the shared tab group counter (advanced by other tab-like transforms).
Signature
export function setTabGroupCounter(value: number): void
Parameters
-
valuenumber
Returns
void
moduletabsTabs Plugin - Pure CSS implementation Transforms <Tabs>/<Tab> components into accessible HTML with CSS :has() based tab…
Tabs Plugin - Pure CSS implementation
Transforms <Tabs>/<Tab> components into accessible HTML with CSS :has() based tab switching (no JavaScript required).
The HTML rewrite is performed in Rust (transformTabsEmbeds in
fntransformTabs(html: string): Promise<string>Transform Tabs components in HTML.
Transform Tabs components in HTML.
Signature
export async function transformTabs(html: string): Promise<string>
Parameters
-
htmlstring
Returns
Promise<string>