diff --git a/crates/forge-web/src/pages/import.rs b/crates/forge-web/src/pages/import.rs index 0b01a40..df0c443 100644 --- a/crates/forge-web/src/pages/import.rs +++ b/crates/forge-web/src/pages/import.rs @@ -161,7 +161,7 @@ pub(crate) async fn newrepo_tabs(lang: Lang, active: &str) -> Result }) } diff --git a/style/_import.scss b/style/_import.scss index b7ec330..3cb97a5 100644 --- a/style/_import.scss +++ b/style/_import.scss @@ -28,10 +28,6 @@ color: var(--accent-ink); border-bottom-color: var(--accent); } - - &.import-tab-end { - margin-left: auto; - } } .import-sources { diff --git a/style/_repo.scss b/style/_repo.scss index a971715..a39f84c 100644 --- a/style/_repo.scss +++ b/style/_repo.scss @@ -593,8 +593,65 @@ height: var(--control-h); } - .segment > span { + // 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. + .segmented .segment { height: calc(var(--control-h) - 6px); + padding: 0 9px; + border-radius: var(--radius-full); + transition: background-color 0.2s ease, box-shadow 0.2s ease; + + > svg { + position: static; + flex: none; + transform: none; + } + + > span { + display: inline-flex; + align-items: center; + box-sizing: border-box; + width: auto; + max-width: 0; + height: calc(var(--control-h) - 6px); + padding: 0; + overflow: hidden; + font-size: 0.8125rem; + line-height: 1; + opacity: 0; + transition: max-width 0.25s ease, padding 0.25s ease, opacity 0.2s ease; + } + + input[type="radio"]:checked ~ span { + background: none; + box-shadow: none; + } + + &:has(input[type="radio"]:checked) { + background: var(--surface); + color: var(--accent-ink); + box-shadow: 0 1px 2px rgba(30, 36, 32, .12); + } + + &:has(input[type="radio"]:focus-visible) { + box-shadow: 0 0 0 2px var(--focus); + } + + // The word opens only for the chosen segment, so the other one stays a plain icon. + &:has(input[type="radio"]:checked) > span { + max-width: 8em; + padding: 0 10px 0 6px; + opacity: 1; + color: var(--accent-ink); + } + } + + @media (prefers-reduced-motion: reduce) { + .segmented .segment, + .segmented .segment > span { + transition: none; + } } } @@ -647,16 +704,16 @@ color: var(--muted); } +// Stacked like the other fields, so the branch input is as wide as the name and description. .newrepo-options { + flex-direction: column; + align-items: stretch; + .newrepo-branch { - flex: 0 1 240px; min-width: 0; } .newrepo-labels { - align-self: flex-end; - align-items: center; - min-height: var(--control-h); margin: 0; } } @@ -731,7 +788,7 @@ } @media (max-width: 480px) { - // Below 480px the visibility switch shows icons only, so Create fits beside it. + // Below 480px the visibility pill and Create share one row, spread to the edges. .newrepo-head-actions { justify-content: space-between; margin-left: 0;