zen-realigned/src/browser/base/content/zen-styles/zen-urlbar.css

488 lines
13 KiB
CSS

/*
* 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/.
*/
/* URL and tool bars */
#urlbar-container {
padding-block: 0 !important;
}
#urlbar {
--toolbarbutton-border-radius: 10px;
--urlbarView-separator-color: var(--zen-colors-border);
--urlbarView-hover-background: var(--toolbarbutton-hover-background);
--urlbarView-highlight-background: var(--toolbarbutton-hover-background);
border-radius: var(--toolbarbutton-border-radius);
padding: 1px;
}
#searchbar:focus-within {
border-color: transparent !important;
}
#urlbar[focused='true'] {
box-shadow: var(--panel-shadow) !important;
}
#urlbar-background {
background: var(--zen-toolbar-element-bg) !important;
outline: none !important;
}
#urlbar-background {
border: 1px solid light-dark(transparent, rgba(255, 255, 255, 0.1)) !important;
margin: 1px;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.1) !important;
:root[zen-single-toolbar='true'] & {
box-shadow: none !important;
}
}
#urlbar[focused='true']:not([suppress-focus-border]) > #urlbar-background,
#searchbar:focus-within {
outline: none !important;
outline-offset: none !important;
outline-color: none !important;
}
#identity-box.chromeUI:not([pageproxystate='invalid']) {
& #identity-icon-box {
background: light-dark(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)) !important;
}
& #identity-icon-label {
display: none;
}
}
#identity-permission-box:not(:hover):not(:focus-within) {
background: transparent !important;
}
#urlbar:is([focused], [open]) > #urlbar-background,
#searchbar:focus-within {
background: var(--urlbar-box-bgcolor);
}
#identity-box:not(.chromeUI) #identity-icon-label {
padding-inline-start: 8px !important;
}
#identity-box.chromeUI:not([pageproxystate='invalid']) #identity-icon-box {
margin-right: 0 !important;
}
#urlbar:not([extend='true']) #identity-box #identity-icon-box {
position: relative;
}
#urlbar:not([breakout-extend='true']) #identity-box:is(:not(.chromeUI), [pageproxystate='invalid']) {
margin-inline-end: 0 !important;
}
.urlbar-page-action,
#tracking-protection-icon-container {
padding: 0 !important;
justify-content: center !important;
align-items: center !important;
margin: 0;
}
#tracking-protection-icon-container {
margin: 0 0 0 2px !important;
}
.urlbar-page-action,
#tracking-protection-icon-container {
width: calc(var(--urlbar-min-height) - 6 * var(--urlbar-container-padding)) !important;
height: calc(var(--urlbar-min-height) - 6 * var(--urlbar-container-padding)) !important;
margin-top: auto !important;
margin-bottom: auto !important;
}
#identity-box:has(#notification-popup-box:not([hidden='true'])) #identity-icon-box,
#identity-box:has(#notification-popup-box:not([hidden='true'])) #identity-permission-box {
margin-right: 0px !important;
}
#identity-box:has(#identity-permission-box:is([hasPermissions], [hasSharingIcon])):not([pageproxystate='invalid'])
#identity-icon-box {
border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important;
margin-right: 0 !important;
}
#tracking-protection-icon-container,
#page-action-buttons {
order: 2 !important;
}
#urlbar[breakout-extend='true'] #urlbar-background {
border: 1px solid var(--zen-colors-border) !important;
}
:root[zen-single-toolbar='true'] {
.urlbar-page-action:not(#star-button-box):not([open]),
#tracking-protection-icon-container {
margin-inline-end: calc(-16px - 2 * var(--urlbar-icon-padding)) !important;
opacity: 0;
transition: all 0.2s;
}
#identity-permission-box > *:not(#permissions-granted-icon) {
visibility: collapse;
}
#urlbar[open] :is(#tracking-protection-icon-container, .urlbar-page-action),
#urlbar:hover :is(#tracking-protection-icon-container, .urlbar-page-action),
.urlbar-page-action[open],
#tracking-protection-icon-container[open] {
opacity: 1;
margin-inline-end: 0 !important;
}
#identity-permission-box:not([open]),
#notification-popup-box:not([open]) {
margin-inline-start: calc(-10px - 2 * var(--urlbar-icon-padding));
opacity: 0;
transition: all 0.2s;
}
#urlbar[open] #identity-permission-box,
#urlbar[open] #notification-popup-box,
#urlbar:hover #identity-permission-box,
#urlbar:hover #notification-popup-box,
#identity-permission-box[open],
#notification-popup-box[open] {
opacity: 1;
margin-inline-start: 0 !important;
}
#notification-popup-box {
align-items: center;
justify-content: center;
height: unset !important;
background: transparent !important;
& > image {
margin-top: auto;
margin-bottom: auto;
height: 24px; /* double 12px */
width: 24px;
&:hover {
background: var(--toolbarbutton-hover-background);
border-radius: var(--toolbarbutton-border-radius);
overflow: visible;
}
}
}
}
:root:not([zen-single-toolbar='true']) {
#notification-popup-box {
border-radius: 999px;
margin: 0 4px 0 0 !important;
padding: 0 4px;
min-width: calc(var(--urlbar-min-height) - 4px - 4 * var(--urlbar-container-padding)) !important;
height: calc(var(--urlbar-min-height) - 4px - 4 * var(--urlbar-container-padding)) !important;
justify-content: center;
gap: 8px;
& > image {
padding: 0;
margin-top: auto;
margin-bottom: auto;
}
}
}
#urlbar[breakout-extend='true'] #notification-popup-box {
min-width: calc(var(--urlbar-min-height) - 4 * var(--urlbar-container-padding)) !important;
height: calc(var(--urlbar-min-height) - 4 * var(--urlbar-container-padding)) !important;
}
button.popup-notification-dropmarker {
border-top-left-radius: 0 !important;
border-bottom-left-radius: 0 !important;
}
.panel-footer:has(button.popup-notification-dropmarker:not([hidden='true'])) button.popup-notification-secondary-button {
border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important;
}
.searchbar-engine-one-off-item {
max-width: 28px;
min-width: 28px !important;
transition: background 0s;
justify-content: center;
}
#downloadsHistory {
margin-top: 5px;
}
#urlbar-container {
container: urlbar-container / inline-size;
z-index: 1;
}
@container urlbar-container (width < 350px) {
#userContext-label {
display: none;
}
}
@media (max-width: 550px) {
#urlbar-container {
width: calc(176px + 2 * (24px + 2 * var(--toolbarbutton-inner-padding)));
}
#nav-bar[downloadsbuttonshown] #urlbar-container,
#nav-bar[unifiedextensionsbuttonshown] #urlbar-container {
width: calc(76px + 24px + 2 * var(--toolbarbutton-inner-padding));
}
#nav-bar[downloadsbuttonshown][unifiedextensionsbuttonshown] #urlbar-container {
width: 176px;
}
#identity-icon-box {
max-width: 70px;
}
#urlbar-zoom-button {
display: none;
}
}
/* Thanks to https://github.com/JLBlk!
* Checkout https://github.com/JLBlk/Zen-Themes/blob/main/SuperUrlBar/SuperUrlBar.css
*/
#notification-popup-box {
border-radius: 10px !important;
}
/* Border radius on hover */
#urlbar .urlbar-page-action,
#urlbar #tracking-protection-icon-container,
#urlbar:not([breakout-extend='true']) #identity-box:is(:not(.chromeUI), [pageproxystate='invalid']) #identity-icon-box {
border-radius: 10px !important;
}
/* Extensions or similar */
#urlbar:not([breakout-extend='true']) #identity-box.chromeUI:not([pageproxystate='invalid']) #identity-icon-box {
border-radius: 10px !important;
}
/* Notification Stack */
.notificationbox-stack {
background: transparent;
&[notificationside='top'] {
position: absolute;
bottom: calc(var(--zen-element-separation) * 1.5);
right: calc(var(--zen-element-separation) * 1.5);
width: fit-content;
max-width: 30rem !important;
& notification-message {
background: color-mix(in srgb, var(--zen-colors-tertiary) 70%, transparent 30%);
backdrop-filter: blur(10px);
border: 1px solid var(--arrowpanel-border-color);
border-radius: var(--zen-border-radius);
&::before {
display: none;
}
}
}
}
#nav-bar,
#zen-sidebar-top-buttons {
min-height: var(--zen-toolbar-height) !important;
height: var(--zen-toolbar-height) !important;
max-height: var(--zen-toolbar-height) !important;
display: flex;
align-items: center;
}
:root:not([zen-single-toolbar='true']) {
& #nav-bar {
margin-bottom: -1px;
}
&[zen-right-side='true']:not([zen-window-buttons-reversed='true']) #nav-bar {
margin-inline-start: var(--zen-element-separation);
}
&:not([zen-right-side='true'])[zen-window-buttons-reversed='true'] #nav-bar {
margin-inline-end: var(--zen-element-separation);
}
}
/* Other small tweaks */
#nav-bar-customization-target {
/* Don't grow if potentially-user-sized elements (like the searchbar or the
* bookmarks toolbar item list) are too wide. This forces them to flex to the
* available space as much as possible, see bug 1795260. */
min-width: 0;
--toolbarbutton-inner-padding: var(--zen-toolbar-button-inner-padding);
/* Add space to beginning of toolbar and make that space click the first <toolbarbutton> */
> :is(toolbarbutton, toolbaritem):first-child,
> toolbarpaletteitem:first-child > :is(toolbarbutton, toolbaritem) {
padding-inline-start: 0;
}
}
/* TODO: Fix this for windows and macos */
/*.titlebar-button:last-child {
padding-right: var(--zen-element-separation) !important;
}*/
#urlbar {
& .search-panel-one-offs-header {
display: none;
}
& .search-panel-one-offs-container .searchbar-engine-one-off-item {
box-shadow: none;
}
}
#urlbar[open] {
--urlbar-margin-inline: 5px !important;
& #identity-box {
margin-right: var(--urlbar-margin-inline);
}
& #urlbar-background {
/* We cant have a transparent background with a backdrop-filter because on normal websites,
the backdrop woudn't work, we would need to apply a clip-path to the site and that's not recommended
due to performance issues */
background-color: light-dark(rgb(247, 247, 247), var(--zen-branding-bg)) !important;
box-shadow: 0 0 1px 1px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.1)) !important;
outline: 1px solid light-dark(rgba(20, 20, 20, 0.2), rgba(235, 235, 235, 0.2)) !important;
outline-offset: -1px !important;
}
}
:root[zen-single-toolbar='true'] {
#urlbar[open] {
min-width: 30vw;
}
&[zen-right-side='true'] #urlbar[open]:not([zen-floating-urlbar='true']) {
right: 0;
}
}
#urlbar[open][zen-floating-urlbar='true'] {
z-index: 1000;
max-width: 45vw;
min-width: 45vw !important;
font-size: 1.1em;
--urlbar-container-height: 55px !important;
--urlbar-margin-inline: 10px !important;
position: absolute;
top: calc(var(--zen-toolbar-height) * 2) !important;
:root[zen-right-side='true'] & {
right: 28vw !important;
}
:root:not([zen-right-side='true']) & {
left: 28vw !important;
}
#urlbar-container:has(&) {
border-radius: 10px;
background: var(--toolbarbutton-hover-background);
}
}
/* Code ~~stolen~~ taken inspiration from https://github.com/greeeen-dev/zen-arc-cmd-bar
*
* MIT License
*
* Copyright (c) 2024 green.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
**/
.urlbarView-title,
.urlbarView-title-separator,
.urlbarView-action,
.urlbarView-url {
margin-top: auto !important;
margin-bottom: auto !important;
}
.urlbarView-title {
font-size: 14px !important;
font-weight: 500 !important;
}
.urlbarView-url,
.urlbarView-title-separator::before {
font-size: 14px !important;
font-weight: 500 !important;
color: #aaa !important;
}
.urlbarView-favicon {
margin-left: 0 !important;
margin-right: 12px !important;
padding: 6px !important;
border-radius: 6px !important;
}
.urlbarView-row[has-action]:is([type='switchtab'], [type='remotetab'], [type='clipboard']) .urlbarView-action {
margin-left: auto !important;
margin-right: 0 !important;
}
.urlbarView-row {
.urlbarView-favicon {
transition: background-color 0.05s;
}
&:hover {
background-color: light-dark(var(--zen-colors-secondary), var(--zen-colors-primary)) !important;
.urlbarView-favicon {
background-color: color-mix(in srgb, var(--zen-branding-bg-reverse) 20%, transparent 80%) !important;
}
.urlbarView-url,
.urlbarView-title-separator::before {
color: color-mix(in srgb, var(--zen-colors-primary) 30%, lightgray) !important;
}
}
}