From 02afd95b7d9567f6bc0e0fd18e893571ac729aad Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Sun, 9 Aug 2020 13:52:29 +0300 Subject: [PATCH] Create status_inside_urlbar_v2.css --- chrome/status_inside_urlbar_v2.css | 65 ++++++++++++++++++++++++++++++ html_resources/tagmap.json | 3 +- tags.csv | 1 + 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 chrome/status_inside_urlbar_v2.css diff --git a/chrome/status_inside_urlbar_v2.css b/chrome/status_inside_urlbar_v2.css new file mode 100644 index 0000000..b9d4c40 --- /dev/null +++ b/chrome/status_inside_urlbar_v2.css @@ -0,0 +1,65 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/status_inside_urlbar_v2.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/status_inside_urlbar.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* STATUSPANEL INSIDE URLBAR */ + +/************** +IMPORTANT WARNING +Using this style can lead to long tab switch times (and probably other problems). Everything may be fine when Firefox starts but situation gets gradually worse, although pretty slowly. +Relevant information: https://bugzilla.mozilla.org/show_bug.cgi?id=1496065 +As a workaround, the -moz-element background image is removed somewhat often which seems work at first glance. But there might still be some related issues on really long sessions. Just be aware. +**************/ + +#urlbar::before{ + z-index: 2; + content: ""; + display: block; + position: absolute; + pointer-events:none; + background-repeat: no-repeat; + background-image: -moz-element(#statuspanel); + background-position: left 2px; + inset: 1px; +} + +/* Using -moz-element() causes some problems after Firefox has been running several hours such as long tab switch times. For this reason the background image is removed on hover and focused states which appears to clear the state. */ + +/* Hide the status ovelay when urlbar is hovered */ +#urlbar:hover::before, +#urlbar[focused]::before{ + visibility: hidden; + /* Remove the image to get rid of -moz-element() related problems */ + background-image: none !important; +} + +:root[uidensity="compact"] #urlbar::before{ background-position-y: 0px } +:root[uidensity="touch"] #urlbar::before{ background-position-y: 3px } + +#statuspanel-inner > #statuspanel-label{ + height:3em; + min-width: 1000px; + background-color: var(--lwt-toolbar-field-focus) !important; + border: none !important; + font-size: 1.15em; + color: inherit !important; + margin-inline: 0px !important; + padding-top: 3px !important; +} + +/* If you use a theme where urlbar is partially transparent you should edit this color to something that closely matches the perceived color of urlbar. Or perhaps use background-image - linear-gradient() can work well here. But keep the color or image opaque or otherwise you'll face an issue where urlbar text bleeds through */ +#statuspanel-inner{ background-color: var(--toolbar-bgcolor) } + +#statuspanel{ color: var(--lwt-toolbar-field-color, black) ; z-index: -1; max-width: 100% !important; } +#statuspanel[type="status"] { color: Highlight } + +/* OPTIONAL FEATURES */ +/* Uncomment to enable */ + +/* Center the statuspanel text. This might be useful with centered urlbar text */ +/* +#statuspanel-inner > #statuspanel-label{ text-align: center } +#urlbar::before{ background-position-x: center !important; } +*/ \ No newline at end of file diff --git a/html_resources/tagmap.json b/html_resources/tagmap.json index e394a60..a3e40c1 100644 --- a/html_resources/tagmap.json +++ b/html_resources/tagmap.json @@ -101,5 +101,6 @@ "window_control_placeholder_support.css":["window-control","patch"], "vertical_popup_menubar.css":["menubar","menu","toolbars","popup"], "classic_firefox_menu_button.css":["classic","menu"], -"bookmarks_toolbar_on_newtabs_only.css":["bookmarks","toolbars","autohide","hiding"] +"bookmarks_toolbar_on_newtabs_only.css":["bookmarks","toolbars","autohide","hiding"], +"status_inside_urlbar_v2.css":["status","urlbar","status","effect","hack"] } diff --git a/tags.csv b/tags.csv index 2e7cf8d..bccea1a 100644 --- a/tags.csv +++ b/tags.csv @@ -101,3 +101,4 @@ window_control_placeholder_support.css,window-control,patch vertical_popup_menubar.css,menubar,menu,toolbars,popup classic_firefox_menu_button.css,classic,menu bookmarks_toolbar_on_newtabs_only.css,bookmarks,toolbars,autohide,hiding +status_inside_urlbar_v2.css,status,urlbar,status,effect,hack