Bug 1435019 - Consolidate urlbar autocomplete popup styling. r=jaws
MozReview-Commit-ID: Ed1BnNwEpNz
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -380,104 +380,36 @@ notification[value="translation"] menuli
display: block;
}
/* AutoComplete */
%include ../shared/autocomplete.inc.css
%include ../shared/urlbar-autocomplete.inc.css
+:root {
+ --urlbar-popup-url-color: -moz-nativehyperlinktext;
+ --urlbar-popup-action-color: -moz-nativehyperlinktext;
+}
+
#PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] {
border-top: 1px solid ThreeDShadow;
}
.ac-title {
font-size: 1.05em;
}
.ac-separator,
.ac-url,
.ac-action,
.ac-tags {
font-size: 0.9em;
}
-html|span.ac-tag {
- background-color: MenuText;
- color: Menu;
- border-radius: 2px;
- border: 1px solid transparent;
- padding: 0 1px;
-}
-
-.ac-separator:not([selected=true]),
-.ac-url:not([selected=true]),
-.ac-action:not([selected=true]) {
- color: -moz-nativehyperlinktext;
-}
-
-.ac-tags-text[selected] > html|span.ac-tag {
- background-color: HighlightText;
- color: Highlight;
-}
-
-html|span.ac-emphasize-text-title,
-html|span.ac-emphasize-text-tag,
-html|span.ac-emphasize-text-url {
- font-weight: 600;
-}
-
-.ac-type-icon[type=bookmark] {
- list-style-image: url("chrome://browser/skin/bookmark.svg");
- -moz-context-properties: fill;
- fill: #b2b2b2;
-}
-
-.ac-type-icon[type=bookmark][selected][current] {
- fill: white;
-}
-
-.ac-type-icon[type=keyword],
-.ac-site-icon[type=searchengine] {
- list-style-image: url(chrome://browser/skin/search-glass.svg);
- -moz-context-properties: fill;
- fill: GrayText;
-}
-
-.ac-type-icon[type=keyword][selected],
-.ac-site-icon[type=searchengine][selected] {
- fill: highlighttext;
-}
-
-.ac-type-icon[type=switchtab],
-.ac-type-icon[type=remotetab] {
- list-style-image: url("chrome://browser/skin/urlbar-tab.svg");
- -moz-context-properties: fill;
- fill: #b2b2b2;
-}
-
-.ac-type-icon[type=switchtab][selected],
-.ac-type-icon[type=remotetab][selected] {
- fill: white;
-}
-
-.autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) {
- color: GrayText;
-}
-
-.autocomplete-treebody::-moz-tree-cell-text(suggesthint, treecolAutoCompleteComment),
-.autocomplete-treebody::-moz-tree-cell-text(suggestfirst, treecolAutoCompleteComment) {
- color: GrayText;
- font-size: smaller;
-}
-
-.autocomplete-treebody::-moz-tree-cell(suggesthint) {
- border-top: 1px solid GrayText;
-}
-
/* Bookmarking panel */
#editBookmarkPanelStarIcon {
list-style-image: url("chrome://browser/skin/places/starred48.png");
width: 48px;
height: 48px;
}
#editBookmarkPanelTitle {
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -326,16 +326,21 @@ html|input.urlbar-input {
%include ../shared/urlbarSearchSuggestionsNotification.inc.css
/* ----- AUTOCOMPLETE ----- */
%include ../shared/autocomplete.inc.css
%include ../shared/urlbar-autocomplete.inc.css
+:root {
+ --urlbar-popup-url-color: hsl(210, 77%, 47%);
+ --urlbar-popup-action-color: hsl(178, 100%, 28%);
+}
+
/* Give an extra margin top to align the top of the awesomebar with the
* bottom of the nav bar, OSX calculates the panel position with an missing
* 1px - https://bugzilla.mozilla.org/show_bug.cgi?id=1406353
*/
#PopupAutoCompleteRichResult {
margin-top: 1px;
}
@@ -349,96 +354,16 @@ html|input.urlbar-input {
.ac-separator,
.ac-url,
.ac-action,
.ac-tags {
font-size: 12px;
}
-html|span.ac-tag {
- background-color: hsl(216, 0%, 88%);
- color: hsl(0, 0%, 0%);
- border-radius: 2px;
- border: 1px solid transparent;
- padding: 0 1px;
-}
-
-.ac-separator:not([selected=true]) {
- color: hsl(0, 0%, 50%);
-}
-
-.ac-url:not([selected=true]) {
- color: hsl(210, 77%, 47%);
-}
-
-.ac-action:not([selected=true]) {
- color: hsl(178, 100%, 28%);
-}
-
-.ac-tags-text[selected] > html|span.ac-tag {
- background-color: hsl(0, 0%, 100%);
- color: hsl(210, 80%, 40%);
-}
-
-html|span.ac-emphasize-text-title,
-html|span.ac-emphasize-text-tag,
-html|span.ac-emphasize-text-url {
- font-weight: 600;
-}
-
-.ac-type-icon[type=bookmark] {
- list-style-image: url("chrome://browser/skin/bookmark.svg");
- -moz-context-properties: fill;
- fill: #b2b2b2;
-}
-
-.ac-type-icon[type=bookmark][selected][current] {
- fill: white;
-}
-
-.ac-type-icon[type=keyword],
-.ac-site-icon[type=searchengine] {
- list-style-image: url(chrome://browser/skin/search-glass.svg);
- -moz-context-properties: fill;
- fill: GrayText;
-}
-
-.ac-type-icon[type=keyword][selected],
-.ac-site-icon[type=searchengine][selected] {
- fill: highlighttext;
-}
-
-.ac-type-icon[type=switchtab],
-.ac-type-icon[type=remotetab] {
- list-style-image: url("chrome://browser/skin/urlbar-tab.svg");
- -moz-context-properties: fill;
- fill: #b2b2b2;
-}
-
-.ac-type-icon[type=switchtab][selected],
-.ac-type-icon[type=remotetab][selected] {
- fill: white;
-}
-
-.autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) {
- color: GrayText;
-}
-
-.autocomplete-treebody::-moz-tree-cell-text(suggesthint, treecolAutoCompleteComment),
-.autocomplete-treebody::-moz-tree-cell-text(suggestfirst, treecolAutoCompleteComment)
-{
- color: GrayText;
- font-size: smaller;
-}
-
-.autocomplete-treebody::-moz-tree-cell(suggesthint) {
- border-top: 1px solid GrayText;
-}
-
#BMB_bookmarksPopup[side="top"],
#BMB_bookmarksPopup[side="bottom"] {
margin-left: -26px;
margin-right: -26px;
}
#BMB_bookmarksPopup[side="left"],
#BMB_bookmarksPopup[side="right"] {
--- a/browser/themes/shared/autocomplete.inc.css
+++ b/browser/themes/shared/autocomplete.inc.css
@@ -23,16 +23,30 @@
font: icon;
margin-inline-start: 4px;
}
#PopupAutoComplete > richlistbox {
padding: 0;
}
+.autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) {
+ color: GrayText;
+}
+
+.autocomplete-treebody::-moz-tree-cell-text(suggesthint, treecolAutoCompleteComment),
+.autocomplete-treebody::-moz-tree-cell-text(suggestfirst, treecolAutoCompleteComment) {
+ color: GrayText;
+ font-size: smaller;
+}
+
+.autocomplete-treebody::-moz-tree-cell(suggesthint) {
+ border-top: 1px solid GrayText;
+}
+
/* Popup states */
.autocomplete-richlistitem:hover,
treechildren.searchbar-treebody::-moz-tree-row(hover) {
background-color: var(--arrowpanel-dimmed);
}
.autocomplete-richlistitem[selected],
rename from browser/themes/shared/icons/synced-tabs.svg
rename to browser/themes/shared/icons/tab.svg
--- a/browser/themes/shared/jar.inc.mn
+++ b/browser/themes/shared/jar.inc.mn
@@ -163,17 +163,17 @@
skin/classic/browser/search-glass.svg (../shared/icons/search-glass.svg)
skin/classic/browser/send-to-device.svg (../shared/icons/send-to-device.svg)
skin/classic/browser/settings.svg (../shared/icons/settings.svg)
skin/classic/browser/sidebars.svg (../shared/icons/sidebars.svg)
skin/classic/browser/sidebars-right.svg (../shared/icons/sidebars-right.svg)
skin/classic/browser/stop.svg (../shared/icons/stop.svg)
skin/classic/browser/stop-to-reload.svg (../shared/icons/stop-to-reload.svg)
skin/classic/browser/sync.svg (../shared/icons/sync.svg)
- skin/classic/browser/synced-tabs.svg (../shared/icons/synced-tabs.svg)
+ skin/classic/browser/tab.svg (../shared/icons/tab.svg)
skin/classic/browser/bookmarks-toolbar.svg (../shared/icons/bookmarks-toolbar.svg)
skin/classic/browser/webIDE.svg (../shared/icons/webIDE.svg)
skin/classic/browser/window.svg (../shared/icons/window.svg)
skin/classic/browser/zoom-in.svg (../shared/icons/zoom-in.svg)
skin/classic/browser/zoom-out.svg (../shared/icons/zoom-out.svg)
skin/classic/browser/search-engine-placeholder.png (../shared/search/search-engine-placeholder.png)
@@ -226,9 +226,8 @@
skin/classic/browser/places/folder-smart.svg (../shared/places/folder-smart.svg)
skin/classic/browser/places/history.svg (../shared/places/history.svg)
skin/classic/browser/places/unfiledBookmarks.svg (../shared/places/unfiledBookmarks.svg)
skin/classic/browser/privatebrowsing/aboutPrivateBrowsing.css (../shared/privatebrowsing/aboutPrivateBrowsing.css)
skin/classic/browser/privatebrowsing/favicon.svg (../shared/privatebrowsing/favicon.svg)
skin/classic/browser/privatebrowsing/private-browsing.svg (../shared/privatebrowsing/private-browsing.svg)
skin/classic/browser/privatebrowsing/tracking-protection-off.svg (../shared/privatebrowsing/tracking-protection-off.svg)
skin/classic/browser/privatebrowsing/tracking-protection.svg (../shared/privatebrowsing/tracking-protection.svg)
- skin/classic/browser/urlbar-tab.svg (../shared/urlbar-tab.svg)
--- a/browser/themes/shared/menupanel.inc.css
+++ b/browser/themes/shared/menupanel.inc.css
@@ -70,17 +70,17 @@
}
#appMenu-library-history-button {
list-style-image: url(chrome://browser/skin/history.svg);
}
#appMenuRecentlyClosedTabs,
#appMenu-library-remotetabs-button {
- list-style-image: url("chrome://browser/skin/synced-tabs.svg");
+ list-style-image: url("chrome://browser/skin/tab.svg");
}
#PanelUI-remotetabs-syncnow {
list-style-image: url("chrome://browser/skin/sync.svg");
}
#PanelUI-remotetabs-view-managedevices {
list-style-image: url("chrome://browser/skin/device-mobile.svg");
--- a/browser/themes/shared/searchbar.inc.css
+++ b/browser/themes/shared/searchbar.inc.css
@@ -57,17 +57,17 @@
margin-bottom: 1px !important;
}
.search-panel-current-input > label {
margin: 2px 0 !important;
}
.search-panel-input-value {
- color: -moz-fieldtext;
+ color: var(--autocomplete-popup-color);
}
.search-panel-one-offs {
margin: 0 !important;
border-top: 1px solid var(--panel-separator-color);
background-color: var(--arrowpanel-dimmed);
/* Bug 1108841: prevent font-size from affecting the layout */
line-height: 0;
@@ -195,35 +195,45 @@
}
.addengine-item[type=menu] > .toolbarbutton-menu-dropmarker {
display: -moz-box;
-moz-appearance: menuarrow !important;
list-style-image: none;
}
+.search-panel-tree > .autocomplete-treebody,
+.search-panel-tree > .autocomplete-treebody::-moz-tree-row {
+ background: none;
+}
+
.search-panel-tree > .autocomplete-treebody::-moz-tree-cell {
border-top: none !important;
}
+.search-panel-tree > .autocomplete-treebody::-moz-tree-cell-text {
+ color: var(--autocomplete-popup-color) !important;
+}
+
.search-panel-tree > .autocomplete-treebody::-moz-tree-image {
padding-inline-start: 2px;
padding-inline-end: 2px;
width: 14px;
height: 14px;
}
.search-panel-tree > .autocomplete-treebody::-moz-tree-image(fromhistory) {
list-style-image: url("chrome://browser/skin/history.svg");
-moz-context-properties: fill;
- fill: graytext;
+ fill: currentColor;
+ fill-opacity: 0.6;
}
.search-panel-tree > .autocomplete-treebody::-moz-tree-image(fromhistory, selected) {
- fill: HighlightText;
+ fill-opacity: 1;
}
.search-setting-button {
-moz-appearance: none;
margin: 0;
min-height: 32px;
}
--- a/browser/themes/shared/sidebar.inc.css
+++ b/browser/themes/shared/sidebar.inc.css
@@ -150,13 +150,13 @@ toolbarseparator + #sidebar-extensions-s
list-style-image: url(chrome://browser/skin/history.svg);
-moz-context-properties: fill;
fill: currentColor;
opacity: 0.8;
}
#sidebar-switcher-tabs > .toolbarbutton-icon,
#sidebar-box[sidebarcommand="viewTabsSidebar"] > #sidebar-header > #sidebar-switcher-target > #sidebar-icon {
- list-style-image: url(chrome://browser/skin/synced-tabs.svg);
+ list-style-image: url(chrome://browser/skin/tab.svg);
-moz-context-properties: fill;
fill: currentColor;
opacity: 0.8;
}
--- a/browser/themes/shared/toolbarbutton-icons.inc.css
+++ b/browser/themes/shared/toolbarbutton-icons.inc.css
@@ -203,17 +203,17 @@ toolbar[brighttext] {
list-style-image: url("chrome://browser/skin/open.svg");
}
#save-page-button {
list-style-image: url("chrome://browser/skin/save.svg");
}
#sync-button {
- list-style-image: url("chrome://browser/skin/synced-tabs.svg");
+ list-style-image: url("chrome://browser/skin/tab.svg");
}
#feed-button {
list-style-image: url("chrome://browser/skin/feed.svg");
}
#characterencoding-button {
list-style-image: url("chrome://browser/skin/characterEncoding.svg");
--- a/browser/themes/shared/urlbar-autocomplete.inc.css
+++ b/browser/themes/shared/urlbar-autocomplete.inc.css
@@ -1,29 +1,112 @@
%if 0
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%endif
+:root {
+ --autocomplete-popup-background: -moz-field;
+ --autocomplete-popup-color: -moz-fieldtext;
+ --autocomplete-popup-highlight-background: Highlight;
+ --autocomplete-popup-highlight-color: HighlightText;
+}
+
#treecolAutoCompleteImage {
max-width: 36px;
}
+#PopupAutoCompleteRichResult,
+#PopupSearchAutoComplete {
+ background: var(--autocomplete-popup-background);
+ color: var(--autocomplete-popup-color);
+}
+
#PopupAutoCompleteRichResult .autocomplete-richlistbox {
padding: 4px 3px;
+ background: transparent;
+ color: inherit;
}
#PopupAutoCompleteRichResult .autocomplete-richlistitem {
min-height: 30px;
font: message-box;
border-radius: 2px;
padding-inline-start: var(--item-padding-start);
/* For the space after the autocomplete text we have to use a transparent
border instead of padding, because the latter would considered part of the
scrollable area when generating the overflow events that we use to
constrain the autocomplete result item size. */
border-inline-end: var(--item-padding-end) solid transparent;
}
+#PopupAutoCompleteRichResult .autocomplete-richlistitem[selected],
+.search-panel-tree > .autocomplete-treebody::-moz-tree-row(selected) {
+ background: var(--autocomplete-popup-highlight-background);
+ color: var(--autocomplete-popup-highlight-color);
+}
+
+.search-panel-tree > .autocomplete-treebody::-moz-tree-cell-text(selected) {
+ color: var(--autocomplete-popup-highlight-color) !important;
+}
+
:root[uidensity=touch] #PopupAutoCompleteRichResult .autocomplete-richlistitem {
min-height: 40px;
}
+
+/* Awesomebar popup items */
+
+.ac-separator:not([selected=true]) {
+ color: GrayText;
+}
+
+.ac-url:not([selected=true]) {
+ color: var(--urlbar-popup-url-color);
+}
+
+.ac-action:not([selected=true]) {
+ color: var(--urlbar-popup-action-color);
+}
+
+html|span.ac-tag {
+ background-color: var(--arrowpanel-dimmed);
+ border-radius: 2px;
+ border: 1px solid var(--panel-separator-color);
+ padding: 0 1px;
+}
+
+.ac-tags-text[selected] > html|span.ac-tag {
+ background-color: var(--autocomplete-popup-highlight-color);
+ color: var(--autocomplete-popup-highlight-background);
+}
+
+html|span.ac-emphasize-text-title,
+html|span.ac-emphasize-text-tag,
+html|span.ac-emphasize-text-url {
+ font-weight: 600;
+}
+
+.ac-site-icon,
+.ac-type-icon {
+ -moz-context-properties: fill, fill-opacity;
+ fill: currentColor;
+ fill-opacity: 0.6;
+}
+
+.ac-site-icon[selected],
+.ac-type-icon[selected] {
+ fill-opacity: 1;
+}
+
+.ac-type-icon[type=bookmark] {
+ list-style-image: url("chrome://browser/skin/bookmark.svg");
+}
+
+.ac-type-icon[type=keyword],
+.ac-site-icon[type=searchengine] {
+ list-style-image: url(chrome://browser/skin/search-glass.svg);
+}
+
+.ac-type-icon[type=switchtab],
+.ac-type-icon[type=remotetab] {
+ list-style-image: url("chrome://browser/skin/tab.svg");
+}
deleted file mode 100644
--- a/browser/themes/shared/urlbar-tab.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
- <path fill="context-fill" d="M15 11h-1V5a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v6H1a1 1 0 0 0 0 2h14a1 1 0 1 0 0-2z"></path>
-</svg>
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -604,129 +604,36 @@ html|*.urlbar-input:-moz-lwtheme::placeh
.ac-title {
font-size: 14px;
}
.ac-tags {
font-size: 12px;
}
-html|span.ac-tag {
- border-radius: 2px;
- border: 1px solid transparent;
- padding: 0 1px;
-}
-
.ac-separator,
.ac-url,
.ac-action {
font-size: 12px;
}
-html|span.ac-emphasize-text-title,
-html|span.ac-emphasize-text-tag,
-html|span.ac-emphasize-text-url {
- font-weight: 600;
-}
-
@media (-moz-windows-default-theme) {
- .ac-title:not([selected=true]) {
- color: hsl(0, 0%, 0%);
- }
-
- .ac-separator:not([selected=true]) {
- color: hsl(0, 0%, 50%);
- }
-
- .ac-url:not([selected=true]) {
- color: hsl(210, 77%, 47%);
- }
-
- .ac-action:not([selected=true]) {
- color: hsl(178, 100%, 28%);
- }
-
- html|span.ac-tag {
- background-color: hsl(216, 0%, 88%);
- color: hsl(0, 0%, 0%);
- }
-
- .ac-tags-text[selected] > html|span.ac-tag {
- background-color: hsl(0, 0%, 100%);
- color: hsl(210, 80%, 40%);
+ :root {
+ --urlbar-popup-url-color: hsl(210, 77%, 47%);
+ --urlbar-popup-action-color: hsl(178, 100%, 28%);
}
}
@media (-moz-windows-default-theme: 0) {
- .ac-separator:not([selected=true]),
- .ac-url:not([selected=true]),
- .ac-action:not([selected=true]) {
- color: -moz-nativehyperlinktext;
- }
-
- html|span.ac-tag {
- background-color: -moz-FieldText;
- color: -moz-Field;
- }
-
- .ac-tags-text[selected] > html|span.ac-tag {
- background-color: HighlightText;
- color: Highlight;
+ :root {
+ --urlbar-popup-url-color: -moz-nativehyperlinktext;
+ --urlbar-popup-action-color: -moz-nativehyperlinktext;
}
}
-.ac-type-icon[type=bookmark] {
- list-style-image: url("chrome://browser/skin/bookmark.svg");
- -moz-context-properties: fill;
- fill: #b2b2b2;
-}
-
-.ac-type-icon[type=bookmark][selected][current] {
- fill: white;
-}
-
-.ac-type-icon[type=keyword],
-.ac-site-icon[type=searchengine] {
- list-style-image: url(chrome://browser/skin/search-glass.svg);
- -moz-context-properties: fill;
- fill: GrayText;
-}
-
-.ac-type-icon[type=keyword][selected],
-.ac-site-icon[type=searchengine][selected] {
- fill: highlighttext;
-}
-
-.ac-type-icon[type=switchtab],
-.ac-type-icon[type=remotetab] {
- list-style-image: url("chrome://browser/skin/urlbar-tab.svg");
- -moz-context-properties: fill;
- fill: #b2b2b2;
-}
-
-.ac-type-icon[type=switchtab][selected],
-.ac-type-icon[type=remotetab][selected] {
- fill: white;
-}
-
-.autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) {
- color: GrayText;
-}
-
-.autocomplete-treebody::-moz-tree-cell-text(suggesthint, treecolAutoCompleteComment),
-.autocomplete-treebody::-moz-tree-cell-text(suggestfirst, treecolAutoCompleteComment)
-{
- color: GrayText;
- font-size: smaller;
-}
-
-.autocomplete-treebody::-moz-tree-cell(suggesthint) {
- border-top: 1px solid GrayText;
-}
-
/* bookmarking panel */
#editBookmarkPanelStarIcon {
list-style-image: url("chrome://browser/skin/places/starred48.png");
width: 48px;
height: 48px;
}