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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
/* 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/. */
@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
xul|findbar {
border-top: 1px solid ThreeDShadow;
min-width: 1px;
transition-property: margin-bottom, visibility;
transition-duration: 150ms, 0s;
transition-timing-function: ease-in-out, linear;
padding-block: 6px;
background-color: -moz-dialog;
color: -moz-dialogtext;
&:where([hidden]) {
/* Override display:none to make the transition work. */
display: flex;
margin-bottom: calc(-1 * (28px + 12px + 1px)); /* findbar-container's height + padding-block + top border */
visibility: collapse;
transition-delay: 0s, 150ms;
> .findbar-container,
> .findbar-closebutton {
opacity: 0;
}
}
@media (prefers-reduced-motion) {
transition-duration: 0s;
transition-delay: 0s;
}
&[noanim],
&[noanim] > .findbar-container,
&[noanim] > .findbar-closebutton,
/* When letterboxing is in use, we do not transition to avoid layout jank.
* This has an additional benefit that the find bar cannot be used to
* fingerprint prefers-reduced-motion. */
#tabbrowser-tabpanels.letterboxing > .browserSidebarContainer > .browserContainer > & {
transition-duration: 0s;
transition-delay: 0s;
}
}
.findbar-container {
margin-inline-start: 8px;
height: 28px;
overflow-inline: hidden; /* Ensures the close button stays visible. */
transition: opacity 150ms ease-in-out;
}
/* Remove start margin when close button is on the left side (on macOS) */
.findbar-closebutton + .findbar-container {
margin-inline-start: 0;
}
/* Search field */
.findbar-textbox {
appearance: none;
background-color: var(--input-bgcolor, var(--toolbar-field-background-color));
color: var(--input-color, var(--toolbar-field-color));
border: 1px solid var(--input-border-color);
border-radius: var(--border-radius-small);
outline: none;
margin: 0;
padding: 2px 5px;
padding-inline-start: 8px;
width: 18em;
box-sizing: border-box;
&::placeholder {
opacity: 0.69;
}
&:focus {
background-color: var(--toolbar-field-focus-background-color);
color: var(--toolbar-field-focus-color);
border-color: transparent;
outline: var(--focus-outline);
outline-offset: var(--focus-outline-inset);
outline-color: var(--toolbar-field-focus-border-color);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.23);
}
:root[lwtheme] &::selection {
background-color: var(--lwt-toolbar-field-highlight, Highlight);
color: var(--lwt-toolbar-field-highlight-text, HighlightText);
}
:root[lwtheme] &:not(:focus)::selection {
background-color: var(--lwt-toolbar-field-highlight, text-select-background-disabled);
}
&[status="notfound"] {
background-color: rgba(226, 40, 80, 0.3);
color: inherit;
}
&[flash="true"] {
background-color: rgba(255, 233, 0, 0.3);
color: inherit;
}
}
/* Previous/next buttons */
.findbar-find-previous,
.findbar-find-next {
appearance: none;
padding: 4px 7px;
-moz-context-properties: fill;
fill: var(--toolbarbutton-icon-fill);
color: inherit;
border-radius: var(--border-radius-small);
&:focus-visible {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-inset);
}
&:not([disabled]):hover {
background-color: var(--toolbarbutton-hover-background, rgba(190, 190, 190, 0.2));
}
&:not([disabled]):hover:active {
background-color: var(--toolbarbutton-active-background, rgba(190, 190, 190, 0.4));
}
&[disabled="true"] > .toolbarbutton-icon {
opacity: var(--toolbarbutton-disabled-opacity);
}
}
.findbar-find-previous {
list-style-image: url(chrome://global/skin/icons/arrow-up.svg);
margin-inline: 8px 0;
}
.findbar-find-next {
list-style-image: url(chrome://global/skin/icons/arrow-down.svg);
margin-inline: 0 8px;
}
/* Checkboxes & Labels */
.findbar-container > checkbox,
.findbar-label {
margin: 0 8px;
flex-shrink: 0;
}
.findbar-find-status,
.found-matches {
margin-inline-start: 12px;
}
.findbar-find-status[status="notfound"] {
font-weight: var(--font-weight-bold);
}
.find-status-icon {
display: none;
}
/* Since the find bar is not fully responsive, and most checkboxes cannot fit
* within the width of a single split-view panel, we hide them. */
.split-view-panel .findbar-container > checkbox {
display: none;
}
/* Close button */
/* Increase specificity to override close-icon.css */
.close-icon.findbar-closebutton {
margin: 2px 8px;
width: 24px;
fill: var(--toolbarbutton-icon-fill);
transition: opacity 150ms ease-in-out;
&:hover {
background-color: var(--toolbarbutton-hover-background, rgba(190, 190, 190, 0.2));
outline: none;
}
&:hover:active {
background-color: var(--toolbarbutton-active-background, rgba(190, 190, 190, 0.4));
}
}
|