Sha256: 4d1c04e402c3c5d66b3deee6be9ba9b8e76d581e45b5daf019a9f9cb3d9cfc3b
Contents?: true
Size: 1.17 KB
Versions: 7
Compression:
Stored size: 1.17 KB
Contents
import '@github/tab-container-element' // // keep in sync with tab_container_component.rb // const DEFAULT_SELECTED_CLASSES: string[] = ['ariadne-border-indigo-500', 'ariadne-text-indigo-600'] // const DEFAULT_UNSELECTED_CLASSES: string[] = [ // 'ariadne-text-gray-500', // 'hover:ariadne-text-gray-700', // 'hover:ariadne-border-gray-300' // ] // for (const tabContainer of document.getElementsByTagName('tab-container')) { // tabContainer.addEventListener('tab-container-change', function (event: Event) { // const newPanel = (event as CustomEvent).detail.relatedTarget as HTMLElement // const tabContainer = newPanel.closest('tab-container') as HTMLElement // const tabList = tabContainer.firstElementChild as HTMLElement // const currentTab = tabList.querySelector('[aria-selected="true"]') as HTMLElement // const tabId = newPanel.getAttribute('id')?.split('-').slice(1).join('-') // const newTab = tabList.querySelector(`#${tabId}`) as HTMLElement // currentTab.classList.remove(...DEFAULT_SELECTED_CLASSES) // currentTab.classList.add(...DEFAULT_UNSELECTED_CLASSES) // newTab.classList.add(...DEFAULT_SELECTED_CLASSES) // newTab.classList.remove(...DEFAULT_UNSELECTED_CLASSES) // }) // }
Version data entries
7 entries across 7 versions & 1 rubygems