fix(css): remove duplicate focus styling and fix omnibox container rendering
- commit
- 12a6535d16ed9c7c3cb533a749cdf0802f0c4c1a
- author
- bnema · · 2025-12-16 21:41 UTC
- parent
- 75c1a27
- signature
- unsigned
1 file · +20 -8
M internal/ui/theme/css.go +20 -8
| @@ -109,17 +109,17 @@ button.tab-button.tab-button-active { | |||
| 109 | 109 | func generateOmniboxCSS(p Palette) string { | |
| 110 | 110 | return `/* ===== Omnibox Styling ===== */ | |
| 111 | 111 | ||
| 112 | - | /* Omnibox window - floating popup */ | |
| 113 | - | window.omnibox-window { | |
| 114 | - | background-color: var(--surface-variant); | |
| 115 | - | border: 0.0625em solid var(--border); | |
| 116 | - | border-radius: 0.1875em; | |
| 112 | + | /* Omnibox outer container - for positioning in overlay */ | |
| 113 | + | .omnibox-outer { | |
| 114 | + | /* Positioning is handled via SetHalign/SetValign/SetMarginTop in Go */ | |
| 117 | 115 | } | |
| 118 | 116 | ||
| 119 | - | /* Main container */ | |
| 117 | + | /* Omnibox main container - the visible popup */ | |
| 120 | 118 | .omnibox-container { | |
| 119 | + | background-color: var(--surface-variant); | |
| 120 | + | border: 0.0625em solid var(--border); | |
| 121 | + | border-radius: 0.1875em; | |
| 121 | 122 | padding: 0; | |
| 122 | - | background-color: transparent; | |
| 123 | 123 | } | |
| 124 | 124 | ||
| 125 | 125 | /* Header with History/Favorites toggle */ | |
| @@ -165,9 +165,21 @@ window.omnibox-window { | |||
| 165 | 165 | caret-color: var(--accent); | |
| 166 | 166 | } | |
| 167 | 167 | ||
| 168 | - | .omnibox-entry:focus { | |
| 168 | + | entry.omnibox-entry:focus, | |
| 169 | + | entry.omnibox-entry:focus-within, | |
| 170 | + | entry.omnibox-entry:focus-visible { | |
| 169 | 171 | border-color: var(--accent); | |
| 170 | 172 | background-color: shade(var(--bg), 1.05); | |
| 173 | + | outline-style: none; | |
| 174 | + | outline-width: 0; | |
| 175 | + | outline-color: transparent; | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | /* Override any internal focus styling */ | |
| 179 | + | entry.omnibox-entry > *:focus, | |
| 180 | + | entry.omnibox-entry > *:focus-visible { | |
| 181 | + | outline-style: none; | |
| 182 | + | outline-color: transparent; | |
| 171 | 183 | } | |
| 172 | 184 | ||
| 173 | 185 | /* Scrolled window for suggestions */ | |
| @@ -109,17 +109,17 @@ button.tab-button.tab-button-active { | |||||
| 109 | func generateOmniboxCSS(p Palette) string { | 109 | func generateOmniboxCSS(p Palette) string { | ||
| 110 | return `/* ===== Omnibox Styling ===== */ | 110 | return `/* ===== Omnibox Styling ===== */ | ||
| 111 | 111 | ||||
| 112 | - | /* Omnibox window - floating popup */ | 112 | + | /* Omnibox outer container - for positioning in overlay */ |
| 113 | - | window.omnibox-window { | 113 | + | .omnibox-outer { |
| 114 | - | background-color: var(--surface-variant); | 114 | + | /* Positioning is handled via SetHalign/SetValign/SetMarginTop in Go */ |
| 115 | - | border: 0.0625em solid var(--border); | |||
| 116 | - | border-radius: 0.1875em; | |||
| 117 | } | 115 | } | ||
| 118 | 116 | ||||
| 119 | - | /* Main container */ | 117 | + | /* Omnibox main container - the visible popup */ |
| 120 | .omnibox-container { | 118 | .omnibox-container { | ||
| 119 | + | background-color: var(--surface-variant); | |||
| 120 | + | border: 0.0625em solid var(--border); | |||
| 121 | + | border-radius: 0.1875em; | |||
| 121 | padding: 0; | 122 | padding: 0; | ||
| 122 | - | background-color: transparent; | |||
| 123 | } | 123 | } | ||
| 124 | 124 | ||||
| 125 | /* Header with History/Favorites toggle */ | 125 | /* Header with History/Favorites toggle */ | ||
| @@ -165,9 +165,21 @@ window.omnibox-window { | |||||
| 165 | caret-color: var(--accent); | 165 | caret-color: var(--accent); | ||
| 166 | } | 166 | } | ||
| 167 | 167 | ||||
| 168 | - | .omnibox-entry:focus { | 168 | + | entry.omnibox-entry:focus, |
| 169 | + | entry.omnibox-entry:focus-within, | |||
| 170 | + | entry.omnibox-entry:focus-visible { | |||
| 169 | border-color: var(--accent); | 171 | border-color: var(--accent); | ||
| 170 | background-color: shade(var(--bg), 1.05); | 172 | background-color: shade(var(--bg), 1.05); | ||
| 173 | + | outline-style: none; | |||
| 174 | + | outline-width: 0; | |||
| 175 | + | outline-color: transparent; | |||
| 176 | + | } | |||
| 177 | + | ||||
| 178 | + | /* Override any internal focus styling */ | |||
| 179 | + | entry.omnibox-entry > *:focus, | |||
| 180 | + | entry.omnibox-entry > *:focus-visible { | |||
| 181 | + | outline-style: none; | |||
| 182 | + | outline-color: transparent; | |||
| 171 | } | 183 | } | ||
| 172 | 184 | ||||
| 173 | /* Scrolled window for suggestions */ | 185 | /* Scrolled window for suggestions */ | ||