diff --git a/toolkit/themes/linux/global/autocomplete.css b/toolkit/themes/linux/global/autocomplete.css index b9cbb536649..fffa2b1f035 100644 --- a/toolkit/themes/linux/global/autocomplete.css +++ b/toolkit/themes/linux/global/autocomplete.css @@ -117,23 +117,26 @@ treechildren.autocomplete-treebody::-moz-tree-cell-text(selected) { color: MenuText; } +.ac-url-box { + /* When setting a vertical margin here, half of that needs to be added + .ac-title-box's translateY for when .ac-url-box is hidden (see below). */ + margin-top: 1px; +} + .autocomplete-richlistitem[actiontype="keyword"] .ac-url-box, .autocomplete-richlistitem[actiontype="searchengine"] .ac-url-box, .autocomplete-richlistitem[actiontype="visiturl"] .ac-url-box, .autocomplete-richlistitem[type~="autofill"] .ac-url-box { - display: none; + visibility: hidden; } .autocomplete-richlistitem[actiontype="keyword"] .ac-title-box, .autocomplete-richlistitem[actiontype="searchengine"] .ac-title-box, .autocomplete-richlistitem[actiontype="visiturl"] .ac-title-box, .autocomplete-richlistitem[type~="autofill"] .ac-title-box { - margin-top: 12px; - margin-bottom: 12px; -} - -.ac-url-box { - margin-top: 1px; + /* Center the title by moving it down by half of .ac-url-box's height, + including vertical margins (if any). */ + transform: translateY(.5em); } .ac-site-icon { diff --git a/toolkit/themes/osx/global/autocomplete.css b/toolkit/themes/osx/global/autocomplete.css index 50815a8dbeb..7d0cce2e4cc 100644 --- a/toolkit/themes/osx/global/autocomplete.css +++ b/toolkit/themes/osx/global/autocomplete.css @@ -102,23 +102,26 @@ treechildren.autocomplete-treebody::-moz-tree-cell-text(selected) { padding: 5px 2px; } +.ac-url-box { + /* When setting a vertical margin here, half of that needs to be added + .ac-title-box's translateY for when .ac-url-box is hidden (see below). */ + margin-top: 1px; +} + .autocomplete-richlistitem[actiontype="keyword"] .ac-url-box, .autocomplete-richlistitem[actiontype="searchengine"] .ac-url-box, .autocomplete-richlistitem[actiontype="visiturl"] .ac-url-box, .autocomplete-richlistitem[type~="autofill"] .ac-url-box { - display: none; + visibility: hidden; } .autocomplete-richlistitem[actiontype="keyword"] .ac-title-box, .autocomplete-richlistitem[actiontype="searchengine"] .ac-title-box, .autocomplete-richlistitem[actiontype="visiturl"] .ac-title-box, .autocomplete-richlistitem[type~="autofill"] .ac-title-box { - margin-top: 12px; - margin-bottom: 12px; -} - -.ac-url-box { - margin-top: 1px; + /* Center the title by moving it down by half of .ac-url-box's height, + including vertical margins (if any). */ + transform: translateY(.5em); } .ac-site-icon { diff --git a/toolkit/themes/windows/global/autocomplete.css b/toolkit/themes/windows/global/autocomplete.css index f6e918e8930..9d0aacbd021 100644 --- a/toolkit/themes/windows/global/autocomplete.css +++ b/toolkit/themes/windows/global/autocomplete.css @@ -130,27 +130,30 @@ treechildren.autocomplete-treebody::-moz-tree-cell-text(selected) { } %endif +.ac-title-box { + margin-top: 4px; +} + +.ac-url-box { + /* When setting a vertical margin here, half of that needs to be added + .ac-title-box's translateY for when .ac-url-box is hidden (see below). */ + margin: 1px 0 4px; +} + .autocomplete-richlistitem[actiontype="keyword"] .ac-url-box, .autocomplete-richlistitem[actiontype="searchengine"] .ac-url-box, .autocomplete-richlistitem[actiontype="visiturl"] .ac-url-box, .autocomplete-richlistitem[type~="autofill"] .ac-url-box { - display: none; + visibility: hidden; } .autocomplete-richlistitem[actiontype="keyword"] .ac-title-box, .autocomplete-richlistitem[actiontype="searchengine"] .ac-title-box, .autocomplete-richlistitem[actiontype="visiturl"] .ac-title-box, .autocomplete-richlistitem[type~="autofill"] .ac-title-box { - margin-top: 12px; - margin-bottom: 12px; -} - -.ac-title-box { - margin-top: 4px; -} - -.ac-url-box { - margin: 1px 0 4px; + /* Center the title by moving it down by half of .ac-url-box's height, + including vertical margins (if any). */ + transform: translateY(calc(.5em + 2px)); } .ac-site-icon {