@use 'theme'; // Snippet-type navigation: a boxed segmented control on a white band, with // each tab separated by a vertical rule and the active tab shown as a // filled tile. .snippet-type-nav { // The tab band scrolls sideways instead of wrapping at any width. overflow-x: auto; scrollbar-width: thin; background: #fff; // The toolbar band above already draws the 1px separator, so only a // bottom border here — a top border would double the line weight. border-block-end: 1px solid #e2e2e4; min-block-size: 53px; // Bleed across the full admin content width, flush against the plugin // toolbar above: counteract the .wrap top margin (10px) plus its 2px / // 20px inline margins and the #wpcontent 20px inline padding. box-sizing: border-box; margin-block-start: -10px; margin-inline-start: -22px; inline-size: calc(100% + 42px); // Core admin switches to 10px #wpcontent padding, 0/12px .wrap margins // below 782px; mirror them so the bar stays flush without overflowing // the viewport. The tabs scroll horizontally on a single row rather than // stacking, with the scrollbar chrome hidden. @media (width <= 782px) { margin-inline-start: -10px; inline-size: calc(100% + 22px); overflow-x: auto; scrollbar-width: none; &::-webkit-scrollbar { display: none; } ul { flex-wrap: nowrap; } .snippet-type-link { white-space: nowrap; } } ul { display: flex; align-items: stretch; flex-wrap: nowrap; min-block-size: 52px; margin: 0; padding: 0; list-style: none; } li { display: flex; margin: 0; } button.snippet-type-link { background: none; border-block: none; border-inline-start: none; font-family: inherit; } .snippet-type-icon { font-size: 22px; inline-size: 24px; block-size: 24px; } .snippet-type-link { display: flex; align-items: center; justify-content: center; gap: 8px; min-inline-size: 100px; padding-block: 0; padding-inline: 24px; cursor: pointer; font-size: 14px; font-weight: 600; line-height: 1.5; color: #646970; text-decoration: none; box-sizing: border-box; border-inline-end: 1px solid #e2e2e4; // The text-only "All Snippets" tab uses a slightly wider gap between // its label and count than tabs that lead with a badge or icon. &.all-type-link { gap: 12px; } svg { display: block; inline-size: 24px; block-size: 24px; } &:hover, &:focus, &:active { color: #2c3337; } &.active-type { background: #f0f0f1; border-color: #f0f0f1; color: theme.$accent; // Children paint over the parent nav's border, so this recolours // the 1px band separator beneath the active tab to match its fill. box-shadow: 0 1px 0 0 #f0f0f1; } // Suppress the persistent focus ring left behind after a mouse click; // keyboard navigation still gets a visible outline via :focus-visible. &:focus-visible { outline: 2px solid theme.$accent; outline-offset: -2px; box-shadow: none; } &:focus:not(:focus-visible) { outline: none; box-shadow: none; } &.pro-locked-type { color: #646970; } } } // Card/table view toggle: a two-icon segmented pair of square tiles with // the active view filled in the accent colour. .snippet-view-toggle { display: flex; align-items: center; gap: 4px; .snippet-view-toggle-option { display: flex; align-items: center; justify-content: center; inline-size: 38px; block-size: 38px; box-sizing: border-box; padding: 0; margin: 0; background: #f0f0f1; color: #646970; border: none; border-radius: 4.5px; cursor: pointer; svg { display: block; } &:hover, &:focus { color: #2c3337; } &.active-view { background: theme.$accent; color: #fff; &:hover, &:focus { color: #fff; } } } } // Slot that adopts the WordPress Screen Options / Help tabs so they appear // directly below the snippet-type nav instead of above the page content. .snippets-screen-meta-slot { #screen-meta-links { float: none; display: flex; justify-content: flex-end; margin: 0; } #screen-meta { margin: 0; } } // Item count shown after a subnav tab's label, as muted text. .snippet-type-nav .subnav-count { font-size: 14px; font-weight: 600; line-height: 1.5; color: #646970; } // The active tab's count adopts the accent alongside its label. .snippet-type-nav .snippet-type-link.active-type .subnav-count { color: theme.$accent; } // The short "All" form of the all-snippets label only replaces "All Snippets" // once the bar collapses; the full form is shown at every wider width. .snippet-type-name-short { display: none; } // Collapse at mid-width and below (through mobile): drop the type names so each // tab shows just its badge and count, and shorten "All Snippets" to "All". Only // the badged manage nav owns a .snippet-type-name; the text-only import/settings // subnav tabs are untouched. Below 782px the bar still scrolls sideways (above), // now with the compact collapsed tabs. @media (width <= 1210px) { .snippet-type-nav .snippet-type-link:not(.all-type-link) .snippet-type-name { display: none; } .snippet-type-nav .all-type-link .snippet-type-name-full { display: none; } .snippet-type-nav .all-type-link .snippet-type-name-short { display: inline; } } // When an admin notice pushes the page content down, restore the gap and top // border above the subnav bar. .notice + .wrap .snippet-type-nav { margin-block-start: 20px; border-block-start: 1px solid theme.$control-border; }