diff --git a/style/_repo.scss b/style/_repo.scss index a39f84c..2cc2220 100644 --- a/style/_repo.scss +++ b/style/_repo.scss @@ -589,17 +589,24 @@ border: 0; // Same height as the Create button beside it. + // The pill keeps its size beside the Create button; it never shrinks to fit the header. .segmented { + flex: none; height: var(--control-h); } // A drawer: the selected segment is the pill and opens its word beside the icon. The other // segment stays icon only. The highlight sits on the segment, so the icon is inside it. The - // selectors repeat .segmented to outrank the shared pill rules in main.scss. + // selectors repeat .segmented to outrank the shared pill rules in main.scss. The icon and the + // word share one row, centred on the pill's middle, and the word never wraps. .segmented .segment { + display: inline-flex; + flex-direction: row; + align-items: center; height: calc(var(--control-h) - 6px); padding: 0 9px; border-radius: var(--radius-full); + white-space: nowrap; transition: background-color 0.2s ease, box-shadow 0.2s ease; > svg { @@ -610,6 +617,7 @@ > span { display: inline-flex; + flex: none; align-items: center; box-sizing: border-box; width: auto; @@ -619,6 +627,7 @@ overflow: hidden; font-size: 0.8125rem; line-height: 1; + white-space: nowrap; opacity: 0; transition: max-width 0.25s ease, padding 0.25s ease, opacity 0.2s ease; } diff --git a/style/main.scss b/style/main.scss index 0219fd1..94f3298 100644 --- a/style/main.scss +++ b/style/main.scss @@ -2026,8 +2026,9 @@ code { margin-top: 12px; } -// Profile tabs: a horizontal underline strip under the header, at every width. Reuses the -// `.tab` and `.tab-count` looks; the sidebar rules for `.repo-tabs` do not apply here. +// Profile tabs: a horizontal underline strip under the header. Reuses the `.tab` and `.tab-count` +// looks; the sidebar rules for `.repo-tabs` do not apply here. Below the sidebar breakpoint the +// strip runs to the screen edges, as `.repo-tabs` does, and the tabs snap as they scroll. .profile-tabs { display: flex; gap: 4px; @@ -2035,11 +2036,36 @@ code { margin: 0; overflow-x: auto; overflow-y: hidden; + scroll-snap-type: x proximity; scrollbar-width: none; &::-webkit-scrollbar { display: none; } + + > .tab { + scroll-snap-align: start; + } +} + +@media (max-width: 899px) { + .profile-tabs { + margin-left: -16px; + margin-right: -16px; + padding: 0 16px; + scroll-padding: 0 16px; + } +} + +// Phones: the four tabs fit the screen width with tighter padding, so Packages is not cut off. +@media (max-width: 480px) { + .profile-tabs { + gap: 0; + + > .tab { + padding: 8px 8px; + } + } } // Pagers: Previous, "Page X of Y", Next in one row.