Visibility label stays on one line and profile tabs fit phone width
Browse files at this commit92c7e697a323edecd0512e02d6a23cb7f6349f32Parent: 4c7677f- style
- visibility label stays on one line and profile tabs fit phone width
2 changed files +38 -3
- style/_repo.scss +10 -1
- style/main.scss +28 -2
style/_repo.scssmodified+10 -1
| @@ -589,17 +589,24 @@ | |||
| 589 | border: 0; | 589 | border: 0; |
| 590 | 590 | ||
| 591 | // Same height as the Create button beside it. | 591 | // Same height as the Create button beside it. |
| 592 | + // The pill keeps its size beside the Create button; it never shrinks to fit the header. | ||
| 592 | .segmented { | 593 | .segmented { |
| 594 | + flex: none; | ||
| 593 | height: var(--control-h); | 595 | height: var(--control-h); |
| 594 | } | 596 | } |
| 595 | 597 | ||
| 596 | // A drawer: the selected segment is the pill and opens its word beside the icon. The other | 598 | // A drawer: the selected segment is the pill and opens its word beside the icon. The other |
| 597 | // segment stays icon only. The highlight sits on the segment, so the icon is inside it. The | 599 | // segment stays icon only. The highlight sits on the segment, so the icon is inside it. The |
| 598 | - // selectors repeat .segmented to outrank the shared pill rules in main.scss. | 600 | + // selectors repeat .segmented to outrank the shared pill rules in main.scss. The icon and the |
| 601 | + // word share one row, centred on the pill's middle, and the word never wraps. | ||
| 599 | .segmented .segment { | 602 | .segmented .segment { |
| 603 | + display: inline-flex; | ||
| 604 | + flex-direction: row; | ||
| 605 | + align-items: center; | ||
| 600 | height: calc(var(--control-h) - 6px); | 606 | height: calc(var(--control-h) - 6px); |
| 601 | padding: 0 9px; | 607 | padding: 0 9px; |
| 602 | border-radius: var(--radius-full); | 608 | border-radius: var(--radius-full); |
| 609 | + white-space: nowrap; | ||
| 603 | transition: background-color 0.2s ease, box-shadow 0.2s ease; | 610 | transition: background-color 0.2s ease, box-shadow 0.2s ease; |
| 604 | 611 | ||
| 605 | > svg { | 612 | > svg { |
| @@ -610,6 +617,7 @@ | |||
| 610 | 617 | ||
| 611 | > span { | 618 | > span { |
| 612 | display: inline-flex; | 619 | display: inline-flex; |
| 620 | + flex: none; | ||
| 613 | align-items: center; | 621 | align-items: center; |
| 614 | box-sizing: border-box; | 622 | box-sizing: border-box; |
| 615 | width: auto; | 623 | width: auto; |
| @@ -619,6 +627,7 @@ | |||
| 619 | overflow: hidden; | 627 | overflow: hidden; |
| 620 | font-size: 0.8125rem; | 628 | font-size: 0.8125rem; |
| 621 | line-height: 1; | 629 | line-height: 1; |
| 630 | + white-space: nowrap; | ||
| 622 | opacity: 0; | 631 | opacity: 0; |
| 623 | transition: max-width 0.25s ease, padding 0.25s ease, opacity 0.2s ease; | 632 | transition: max-width 0.25s ease, padding 0.25s ease, opacity 0.2s ease; |
| 624 | } | 633 | } |
style/main.scssmodified+28 -2
| @@ -2026,8 +2026,9 @@ code { | |||
| 2026 | margin-top: 12px; | 2026 | margin-top: 12px; |
| 2027 | } | 2027 | } |
| 2028 | 2028 | ||
| 2029 | -// Profile tabs: a horizontal underline strip under the header, at every width. Reuses the | 2029 | +// Profile tabs: a horizontal underline strip under the header. Reuses the `.tab` and `.tab-count` |
| 2030 | -// `.tab` and `.tab-count` looks; the sidebar rules for `.repo-tabs` do not apply here. | 2030 | +// looks; the sidebar rules for `.repo-tabs` do not apply here. Below the sidebar breakpoint the |
| 2031 | +// strip runs to the screen edges, as `.repo-tabs` does, and the tabs snap as they scroll. | ||
| 2031 | .profile-tabs { | 2032 | .profile-tabs { |
| 2032 | display: flex; | 2033 | display: flex; |
| 2033 | gap: 4px; | 2034 | gap: 4px; |
| @@ -2035,11 +2036,36 @@ code { | |||
| 2035 | margin: 0; | 2036 | margin: 0; |
| 2036 | overflow-x: auto; | 2037 | overflow-x: auto; |
| 2037 | overflow-y: hidden; | 2038 | overflow-y: hidden; |
| 2039 | + scroll-snap-type: x proximity; | ||
| 2038 | scrollbar-width: none; | 2040 | scrollbar-width: none; |
| 2039 | 2041 | ||
| 2040 | &::-webkit-scrollbar { | 2042 | &::-webkit-scrollbar { |
| 2041 | display: none; | 2043 | display: none; |
| 2042 | } | 2044 | } |
| 2045 | + | ||
| 2046 | + > .tab { | ||
| 2047 | + scroll-snap-align: start; | ||
| 2048 | + } | ||
| 2049 | +} | ||
| 2050 | + | ||
| 2051 | +@media (max-width: 899px) { | ||
| 2052 | + .profile-tabs { | ||
| 2053 | + margin-left: -16px; | ||
| 2054 | + margin-right: -16px; | ||
| 2055 | + padding: 0 16px; | ||
| 2056 | + scroll-padding: 0 16px; | ||
| 2057 | + } | ||
| 2058 | +} | ||
| 2059 | + | ||
| 2060 | +// Phones: the four tabs fit the screen width with tighter padding, so Packages is not cut off. | ||
| 2061 | +@media (max-width: 480px) { | ||
| 2062 | + .profile-tabs { | ||
| 2063 | + gap: 0; | ||
| 2064 | + | ||
| 2065 | + > .tab { | ||
| 2066 | + padding: 8px 8px; | ||
| 2067 | + } | ||
| 2068 | + } | ||
| 2043 | } | 2069 | } |
| 2044 | 2070 | ||
| 2045 | // Pagers: Previous, "Page X of Y", Next in one row. | 2071 | // Pagers: Previous, "Page X of Y", Next in one row. |