@use '../common/badges'; @use '../common/list-table'; @use '../common/theme'; .column-name, .column-type { .dashicons { font-size: 16px; inline-size: 16px; block-size: 16px; vertical-align: middle; } .dashicons-clock { vertical-align: middle; } } // `.wp-list-table` prefix keeps this above WP 7.0's 40px control height so the boxed // priority field stays 30px tall (below the 38px control token, which would stretch the // table rows) and vertically aligned with the rest of the row. .wp-list-table .priority-column input { appearance: none; background: var(--cs-color-surface); border: 1px solid var(--cs-color-border); border-radius: 5px; box-shadow: none; box-sizing: border-box; min-block-size: 30px; block-size: 30px; inline-size: 4em; // Pin the box model so padding/margins/line-height match WP 6.9 regardless of WP 7.0's // taller default control metrics; this keeps the value aligned in both the resting and // hovered (native spinner) states. padding-block: 0; padding-inline: 8px; margin-block: 0; margin-inline: 1px; line-height: 2; color: var(--cs-color-text); text-align: center; &:disabled { color: inherit; } &:hover, &:focus, &:active { color: var(--cs-color-text); border-radius: 5px; appearance: unset; box-shadow: none; outline: 2px solid var(--cs-color-accent); &:disabled { color: inherit; background-color: transparent; } } } .wp-list-table .is-expanded td.column-activate.activate { /* fix for mobile layout */ display: table-cell !important; } .snippet-name-group { display: inline-flex; align-items: center; gap: 6px; max-inline-size: 100%; min-inline-size: 0; .snippet-name { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .badge { flex-shrink: 0; } } .snippet-secure-status { display: inline-flex; align-items: center; block-size: 24px; box-sizing: border-box; flex: 0 0 auto; vertical-align: top; .tooltip-trigger { align-items: center; justify-content: center; inline-size: 24px; block-size: 24px; background: #cbf2d3; border: 1px solid #a9d5b2; border-radius: 5px; color: #1a7f37; svg { display: block; } } } .snippets-card-grid { // Three equal-height cards per row; descriptions are clamped so height // stays uniform regardless of text length. The compound selector wins // over the base .code-snippets-cards auto-fill column rule, which is // emitted later in the compiled stylesheet. // minmax(0, 1fr) lets tracks shrink below their content's min-content // width (wide footer button rows), which plain 1fr tracks cannot, // preventing the grid from overflowing the page horizontally. &.code-snippets-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); @media (width <= 1100px) { grid-template-columns: repeat(2, minmax(0, 1fr)); } @media (width <= 782px) { grid-template-columns: minmax(0, 1fr); } } .code-snippets-card { min-inline-size: 0; } // Reveal the bulk-select checkbox on hover or keyboard focus, and keep // every checkbox visible while any card in the grid is selected so an // in-progress selection is never hidden. .snippet-card-select { opacity: 0; transition: opacity 0.15s ease; @media (prefers-reduced-motion: reduce) { transition-duration: 0.01s; } } .snippet-card-select:checked, &.has-selection .snippet-card-select, .code-snippets-card:hover .snippet-card-select, .code-snippets-card:focus-within .snippet-card-select { opacity: 1; } // Card body bands: header row, meta row, then a separated description. .card-inner { display: flex; flex-flow: column; gap: 16px; } .snippet-card-header { display: flex; align-items: center; gap: 10px; // Insights pills close out this row, so allow wrapping: on a narrow card // they drop to a line of their own rather than squeezing the name away. flex-wrap: wrap; // Keep header content clear of the absolutely-positioned selection checkbox. padding-inline-end: 32px; > a { display: inline-flex; border-radius: 5px; &:focus, &:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--cs-color-surface), 0 0 0 4px var(--cs-color-accent); } } // Insights pills close out the header row, sitting directly below the // selection checkbox in the card corner. End-aligning them in flow means // the header never has to reserve a fixed gutter for a variable-width // group — the heading absorbs the shrink down to its floor, and past // that the pills wrap instead. .cs-insights-trigger { margin-inline-start: auto; flex-wrap: nowrap; flex-shrink: 0; } h3 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.5; // Zero basis, not auto: with a wrapping flex row, line-breaking uses // each item's content width before any shrinking, so an auto-basis // heading would break to its own line whenever the name is long. // A zero basis keeps it on the first line and grows into the slack. flex: 1 1 0; // Let the heading shrink inside the flex row so long names truncate // instead of pushing the header icons out of the card — but not below // a readable stub, or a card with pills shows no name at all. min-inline-size: 9ch; .snippet-name { color: var(--cs-color-accent); text-decoration: none; } .snippet-name-group { display: flex; inline-size: 100%; } } .extra-icons:empty { display: none; } // The accent pill styling lives in common/_switch.scss; keep the // switch from shrinking inside the flex card header. input[type='checkbox'].switch { flex-shrink: 0; } } .snippet-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; line-height: 1.5; border-block-end: 1px solid var(--cs-color-border-subtle); padding-block-end: 16px; .snippet-card-statuses { display: inline-flex; align-items: center; block-size: 24px; box-sizing: border-box; gap: 4px; flex-shrink: 0; > .cs-insights-statuses, > .cs-insights-statuses > .cs-insights-trigger { display: inline-flex; align-items: center; block-size: 24px; box-sizing: border-box; } } .snippet-card-tags-label { color: var(--cs-color-text-muted); } .snippet-card-tags a { color: var(--cs-color-accent); text-decoration: none; &:focus { box-shadow: none; } &:focus-visible { outline: 2px solid var(--cs-color-accent); } } .snippet-card-modified { color: var(--cs-color-text-muted); } &.has-tags .snippet-card-modified { margin-inline-start: auto; } } .snippet-description-content { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: 14px; line-height: 1.5; color: var(--cs-color-text-muted); } // Align the selection checkbox with the taller card header row, so its top // edge matches the insights pills sharing that row. // Qualified with .code-snippets-card to outrank the base // `.code-snippets-card .snippet-card-corner` rule in common/_cards.scss, // which has equal specificity but is emitted later. .code-snippets-card .snippet-card-corner { inset-block-start: 27px; } .code-snippets-card footer { .button { font-size: 14px; line-height: 2.5714; border-radius: 5px; } .button:not(.button-primary) { background: transparent; } } .kebab-menu-priority { justify-content: space-between; // Balances the shorter input so the row matches the height of the menu // items above and below it. padding-block: 5px; input.snippet-priority { inline-size: 52px; block-size: 30px; // WordPress sizes number inputs with a min-height, which would // otherwise win over the height set here. min-block-size: 0; box-sizing: border-box; margin: 0; padding-block: 0; padding-inline: 4px; border: 1px solid var(--cs-color-border-subtle); border-radius: 5px; text-align: center; color: var(--cs-color-text); } } } // Shared table-navigation layout for both snippet views and both toolbars: // bulk actions, select all, tag filter and search on the left, with the item // count, pagination and view toggle pinned to the far end of the row. The // bottom toolbar repeats only the bulk actions and pagination group. .snippets-list-view .tablenav { block-size: auto; margin-block-end: 16px; } .snippets-search-subtitle { margin-block: 0 12px; font-size: 14px; font-style: italic; color: var(--cs-color-text-muted); text-align: center; display: flex; align-items: center; justify-content: center; gap: 1em; } // Keep every table row the same height by clamping the description cell // to two lines, matching the two-line name + row-actions column. .snippets-list-view .wp-list-table td.column-desc .snippet-description-content { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }