1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
/* 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/. */
/* TODO (Bug 2008938): Make in-page Smartbar styling not dependent on chrome styles */
@import url("chrome://browser/skin/urlbar-searchbar.css");
@import url("chrome://browser/skin/urlbarView.css");
:host,
:root {
--smartbar-border-style-gradient: var(--border-width) solid;
--smartbar-border-color-gradient: linear-gradient(172deg, #321bfd -18%, #cf30e2 53%, #ff9900 89%, #f5c451 109%);
--smartbar-border-color-gradient-dark: linear-gradient(270deg, var(--color-orange-40) 0%, var(--color-violet-50) 105.15%);
--smartbar-glow-color: color-mix(in srgb, var(--color-violet-40) 30%, transparent);
--smartbar-max-height: 50vh;
--smartbar-max-width: calc(var(--size-item-xlarge) * 12);
--smartbar-background-color: light-dark(white, var(--color-violet-110));
--smartbar-outline-color: light-dark(var(--color-violet-30), var(--color-violet-50));
--smartbar-outline: var(--focus-outline-width) solid var(--smartbar-outline-color);
}
.smartbar {
display: flex;
flex-direction: column;
max-height: var(--smartbar-max-height);
max-width: var(--smartbar-max-width);
width: 100%;
transition: opacity 0.5s ease-out;
> .urlbarView {
overflow-y: auto;
}
&[hidden] {
display: none;
}
&[open] > .urlbarView {
display: block;
}
&[suggestions-position="top"] > .urlbarView {
order: -1;
z-index: 1;
}
}
.smartbar > .urlbar-input-container {
overflow: visible;
/**
* The search mode switcher won’t be used for the Smartbar. Instead, it is
* part of the CTA action panel.
*/
> .searchmode-switcher {
display: none;
}
}
.smartbar > .urlbar-background {
background-color: white;
background-clip: padding-box, border-box;
background-image: linear-gradient(var(--smartbar-background-color), var(--smartbar-background-color)), var(--smartbar-border-color-gradient);
background-origin: border-box;
border-radius: var(--border-radius-large);
border: var(--smartbar-border-style-gradient) transparent;
/* Pseudo-element for glow effect on hover/focus */
&::before {
border-radius: inherit;
content: "";
inset: 0;
position: absolute;
filter: blur(30px);
background-color: var(--smartbar-glow-color);
opacity: 0;
transition: opacity 0.5s ease-out;
z-index: -1;
@media (prefers-color-scheme: dark) {
background-image: var(--smartbar-border-color-gradient-dark);
}
}
}
/* HOVER and FOCUSED states: Show gradient glow */
.smartbar:hover:not(:focus-within) > .urlbar-background,
.smartbar:focus-within > .urlbar-background {
&::before {
opacity: 0.7;
transition: opacity 0.2s ease-in;
}
}
/* FOCUSED_KEYBOARD_EMPTY: Show outline only for keyboard focus on empty input */
.smartbar:focus-within:not([usertyping]):not([suppress-focus-border]) > .urlbar-background {
outline: var(--smartbar-outline);
outline-offset: var(--focus-outline-offset);
}
.smartbar .urlbar-input-box {
align-items: stretch;
}
.smartbar .urlbar-input {
box-sizing: border-box;
height: auto;
white-space: pre-wrap;
width: 100%;
}
.smartbar moz-multiline-editor {
--multiline-editor-border: none;
--multiline-editor-focus-outline: none;
padding: var(--space-xsmall);
}
.smartbar .urlbar-go-button {
display: none;
}
.smartbar-button-container {
padding: 0 var(--space-large) var(--space-medium);
position: relative;
}
.smartbar-button-container input-cta {
margin-inline-start: auto;
}
.smartbar-context-chips-header {
position: relative;
margin-inline: var(--space-medium);
margin-top: var(--space-medium);
}
|