Repository navigation
Expand file tree
/
Copy pathuserChrome.css
More file actions
728 lines (645 loc) · 31.3 KB
/
Copy pathuserChrome.css
File metadata and controls
728 lines (645 loc) · 31.3 KB
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
/* ================================================================
FIREFOX AUTO-HIDE TOOLBAR — OVERLAY VERSION 29
================================================================
Tabs, the address/search bar, and the bookmarks bar all hide
together and reveal on hover near the top of the window, on
focus (e.g. clicking the urlbar), or during a tab drag.
OVERLAY behavior (windowed mode): #navigator-toolbox is taken out
of normal document flow (position: fixed), so the webpage NEVER
moves — the toolbars float on top of it when revealed, instead of
pushing it down.
PUSH-DOWN behavior ("fullscreen mode" only): #navigator-toolbox
stays in normal document flow instead, so when a toolbar's
max-height grows from 0 to its revealed height, the toolbox itself
grows and pushes #browser (the webpage) down below it — then the
page returns to its original position once the toolbars hide
again. Windowed mode is completely unaffected by this - see
section 1b. Note that "fullscreen mode" here is fake-fullscreen.
uc.js's own toggle, not Firefox's real OS-level fullscreen (see
that script) - the window itself never changes size or mode.
Companion scripts (in the same mod, not part of this file):
- inline-bookmark-folders.uc.js - inline folder expansion, its
own drag-and-drop, and custom context menus. Several rules in
section 4 below (the data-bmif-* attribute selectors) exist
only to style states that script sets.
- cross-window-drag.uc.js - sets [externaldrag] on every other
open window during a cross-window tab drag (see section 3).
- download-forceopen.uc.js - sets [forceopen] for a few seconds
on download start/completion (see section 3).
- fake-fullscreen.uc.js - sets data-uc-fakefullscreen="true" on
:root when the Full Screen command is used, instead of letting
Firefox go real-fullscreen (see section 1b).
- no-newtab-urlbar-focus.uc.js - stops Firefox from automatically
focusing the address bar when a new tab opens. No CSS of its
own; listed here only for a complete picture of the mod.
Sections in this file:
1. Toolbox setup & positioning
1b. Fullscreen push-down override
1c. Native content/video fullscreen override (fully hides the
toolbar over a fullscreened video, e.g. on YouTube)
2. Hover trigger strip
3. Toolbar show/hide states (tabs, nav-bar, bookmarks)
4. Bookmarks toolbar specifics (folder expansion/drag styling,
native "open in container tab" and cut/copy/paste removal)
5. Tab label sizing
6. Address/search bar dropdown fix
7. Multi-row bookmarks bar (third-party, unchanged)
Note: Firefox's vertical-tabs sidebar mode is not supported by
this file — ask if you need that added.
================================================================ */
/* ----------------------------------------------------------------
1. TOOLBOX SETUP & POSITIONING
Takes #navigator-toolbox out of document flow so it can overlay
the page without pushing it. Resets z-index on a few elements
that would otherwise fight with the toolbox's own stacking order.
---------------------------------------------------------------- */
#navigator-toolbox {
/* Shared timing/spacing variables used throughout this file */
--uc-bm-padding: 4px;
--uc-autohide-toolbar-delay: 350ms;
position: fixed !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
z-index: 9999 !important;
overflow: visible !important;
background-color: var(--toolbar-bgcolor, var(--lwt-accent-color, #1c1b22)) !important;
border: none !important;
box-shadow: none !important;
}
/* A Firefox update (the "Nova" redesign, Firefox 157) introduced a
thin gray divider line between the chrome and the page. Root cause
CONFIRMED (not a theory): it's not a border, box-shadow, outline,
background-color, backdrop blur, or native widget theming on any
element in the toolbox/toolbar/content chain - every one of those
was individually checked and ruled out via Firefox's own DevTools,
including forcing :root's own background to the line's exact
measured color (#25242B) and seeing zero change in what rendered.
That last test is what proved it: nothing in this document's CSS
cascade has any influence on this line at all, which means it's
being drawn by Nova's UI natively/at the compositor level, below
anything userChrome.css can reach - a genuine Firefox rendering bug
in that specific redesign, not something this mod caused or could
fix. The actual fix is a separate about:config preference,
browser.nova.enabled, set to false, which reverts the whole Nova
redesign back to the previous UI (and removes the line along with
it) - see install.ps1/uninstall.ps1 and readme.txt, where this is
set for a fresh install. The handful of small CSS resets below
(root background, backdrop-filter, native appearance,
#notifications-toolbar's background) were each tried as a fix for
this same line before the real cause was found - none of them
turned out to matter once Nova was disabled, but they're left in
place since they're harmless and don't hurt anything either way. */
:root {
background-color: #25242b !important;
--chrome-content-separator-color: transparent !important;
}
#navigator-toolbox,
#TabsToolbar,
#nav-bar,
#PersonalToolbar,
#toolbar-menubar {
backdrop-filter: none !important;
-moz-backdrop-filter: none !important;
opacity: 1 !important;
appearance: none !important;
-moz-appearance: none !important;
}
#appcontent,
#tabbrowser-tabbox,
#tabbrowser-tabpanels,
#browser {
border: none !important;
box-shadow: none !important;
}
#notifications-toolbar {
background-color: transparent !important;
background-image: none !important;
border: none !important;
box-shadow: none !important;
}
:root[uidensity="touch"] #navigator-toolbox {
--uc-bm-padding: 6px;
}
#sidebar-box,
#sidebar-main,
#sidebar-splitter,
#tabbrowser-tabbox {
z-index: auto !important;
}
.tabbrowser-tab[selected] {
z-index: 3 !important;
}
#navigator-toolbox > div {
display: contents;
}
/* Pressing Alt normally makes Firefox show its classic menu bar (File,
Edit, View, History, Bookmarks, Tools, Help). This removes that bar
entirely so Alt never shows it, in every mode. */
#toolbar-menubar {
display: none !important;
}
:where(
#navigator-toolbox > #TabsToolbar,
#navigator-toolbox > #toolbar-menubar,
#tab-notification-deck,
.global-notificationbox,
#notifications-toolbar
) {
order: -1;
}
/* Firefox's own native fullscreen auto-hide (browser.fullscreen.autohide)
independently slides the tab strip using its own separate mouse-
position detection and timing - running alongside this file's own
hover-based auto-hide, it caused the tab strip to reveal/hide at a
different trigger point than the address bar and bookmarks bar
below it. The installer (install.ps1) turns this pref off, so
Firefox never applies its own margin-top animation here and every
toolbar's visibility is controlled solely by this file's own rules,
uniformly, in both fullscreen and windowed mode. If that pref ever
gets re-enabled by hand, this symptom is the way to recognize it. */
/* ----------------------------------------------------------------
1b. FULLSCREEN PUSH-DOWN OVERRIDE
Puts #navigator-toolbox back into normal document flow instead of
overlaying it on top of the page: no position:fixed, no fixed
top/left/right anchoring. Its own height is just whatever its
(currently collapsed) toolbar children add up to, so when one of
them reveals and grows from max-height:0 to its real height
(section 3), the toolbox grows right along with it and pushes
#browser - the actual webpage - down below it in normal flow.
Hiding it again shrinks the toolbox back down and the page returns
to exactly where it was.
Keyed off data-uc-fakefullscreen="true", the attribute
fake-fullscreen.uc.js toggles on :root when the Full Screen command
(F11 / the menu item) is used - that script deliberately never
triggers Firefox's own real, OS-level fullscreen, so "turning on
fullscreen mode" changes nothing about the window itself and only
this push-down behavior turns on. :root[sizemode="fullscreen"] is
also matched alongside it, purely as a safety net in case real
fullscreen is ever reached some other way (e.g. the window's own
native title-bar fullscreen control) - it's a no-op in the normal
case, since fake-fullscreen.uc.js never sets it.
Higher specificity (2 IDs vs. 1) than the plain #navigator-toolbox
rule in section 1 above, so this wins whenever it matches, even
though both are !important - ordinary windowed mode never matches
either selector and keeps the overlay behavior from section 1
unchanged.
#navigator-toolbox::before (section 2's 12px hover-trigger strip)
is left as position:fixed regardless of mode - it's only a mouse-
position catcher, not something that needs to occupy real layout
space or move with the page. */
:root[sizemode="fullscreen"] #navigator-toolbox,
:root[data-uc-fakefullscreen="true"] #navigator-toolbox {
position: relative !important;
top: auto !important;
left: auto !important;
right: auto !important;
}
/* ----------------------------------------------------------------
1c. NATIVE CONTENT/VIDEO FULLSCREEN OVERRIDE
When a website puts itself into fullscreen through the standard
Fullscreen API - the fullscreen button on a YouTube/etc. video,
not this mod's own "fullscreen mode" toggle - Firefox sets
inDOMFullscreen="true" on :root and also takes the whole browser
window into real, OS-level fullscreen alongside it. That's
completely separate from fake-fullscreen.uc.js, which only ever
intercepts the F11/menu Full Screen command, never a website's
own fullscreen request. Because entering real content fullscreen
also sets sizemode="fullscreen" - the same attribute section 1b
and 3e's fullscreen safety-net selectors match on - this mod's
own hover-reveal and "always show in fullscreen" behavior would
otherwise kick in here too, drawing this mod's toolbar buttons on
top of the fullscreened video.
display:none on #navigator-toolbox itself removes it - and every
toolbar and the section 2 hover-trigger strip inside/generated
from it - from rendering entirely, with no exceptions: a
display:none ancestor overrides any descendant's own visibility,
max-height, or position:fixed, so this wins regardless of what
section 3e or the hover rules say, without needing to out-specify
each of them individually. Firefox removes inDOMFullscreen the
moment the video's fullscreen ends, so the toolbar comes right
back on its own, with no extra script or state needed. This
matches stock, unmodified Firefox's own behavior for content
fullscreen: no toolbar, no hover reveal, nothing drawn over the
video - whether or not this mod's own fullscreen mode happens to
be on or off at the time. */
:root[inDOMFullscreen="true"] #navigator-toolbox {
display: none !important;
}
/* ----------------------------------------------------------------
2. HOVER TRIGGER STRIP
An always-present 12px strip at the very top of the window that
catches the mouse even when every toolbar below it is fully
collapsed to zero height. Once a toolbar is actually revealed,
pointer-events are handed back to it so clicks/drags work
normally instead of being intercepted by this invisible strip.
---------------------------------------------------------------- */
#navigator-toolbox::before {
content: "" !important;
position: fixed !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
height: 12px !important;
z-index: 10001 !important;
pointer-events: auto !important;
background: transparent !important;
-moz-window-dragging: drag !important;
}
#navigator-toolbox:hover::before,
#navigator-toolbox:focus-within::before,
#navigator-toolbox[externaldrag]::before {
pointer-events: none !important;
}
/* ----------------------------------------------------------------
3. TOOLBAR SHOW/HIDE STATES
All three toolbars share one hidden state (real zero-height via
max-height, not height:auto — Firefox can't delay/transition
height:auto) and each has its own reveal rule below it.
Reveal triggers, shared across all three toolbars:
:hover - mouse over the toolbox
:focus-within - e.g. clicking into the urlbar
[externaldrag] - set by cross-window-drag.uc.js when a
tab is being dragged FROM another window
[movingtab] - set natively by Firefox when a tab is
being dragged WITHIN this window
#mainPopupSet:has(...) - a menu panel is open, OR the mouse is
hovering a right-click context menu or the
native download popup (both detected via
:hover directly, since Firefox's context
menus don't reflect open/closed state as
any markup attribute — a hidden one can
never be hovered, so this works
regardless). #downloadsPanel is explicitly
excluded from the general "any panel is
open" trigger above (so it doesn't
independently keep the toolbar open just
by existing) but still keeps the toolbar
open while the mouse is actually over it —
download-forceopen.uc.js's own precise
3-second timer governs everything else
[window-modal-open] - a modal dialog is open
[customizing] - toolbar customize mode is active
[forceopen] - set for 3 seconds by download-forceopen.uc.js
whenever a download starts or completes,
regardless of mouse position. Repeated
triggers within the window reset the 3s
countdown rather than extending past it
---------------------------------------------------------------- */
/* --- 3a. Shared hidden state --- */
#TabsToolbar,
#nav-bar,
#PersonalToolbar {
background-color: var(--toolbar-bgcolor, var(--lwt-accent-color, #1c1b22)) !important;
background-image: none !important;
overflow: hidden !important;
max-height: 0 !important;
min-height: 0 !important;
visibility: hidden !important;
border: none !important;
box-shadow: none !important;
transition:
visibility 0ms linear var(--uc-autohide-toolbar-delay),
max-height 0ms linear var(--uc-autohide-toolbar-delay),
min-height 0ms linear var(--uc-autohide-toolbar-delay) !important;
}
/* --- 3b. Tabs reveal --- */
#navigator-toolbox:hover #TabsToolbar,
#navigator-toolbox:focus-within #TabsToolbar,
#navigator-toolbox[externaldrag] #TabsToolbar,
#navigator-toolbox[forceopen] #TabsToolbar,
#navigator-toolbox[movingtab] #TabsToolbar,
#mainPopupSet:has(
> [panelopen]:not(#ask-chat-shortcuts, #selection-shortcut-action-panel, #chat-shortcuts-options-panel, #tab-preview-panel, #downloadsPanel)
) ~ #navigator-toolbox #TabsToolbar,
#mainPopupSet:has(menupopup:hover) ~ #navigator-toolbox #TabsToolbar,
#mainPopupSet:has(#downloadsPanel:hover) ~ #navigator-toolbox #TabsToolbar,
:root[window-modal-open] #TabsToolbar,
#TabsToolbar[customizing] {
max-height: 600px !important;
min-height: var(--tab-min-height, 36px) !important;
visibility: visible !important;
overflow: visible !important;
transition-delay: 0s !important;
}
/* --- 3c. Nav-bar (address/search bar) reveal --- */
#navigator-toolbox:hover #nav-bar,
#navigator-toolbox:focus-within #nav-bar,
#navigator-toolbox:has([breakout-extend]) #nav-bar,
#navigator-toolbox[externaldrag] #nav-bar,
#navigator-toolbox[forceopen] #nav-bar,
#mainPopupSet:has(
> [panelopen]:not(#ask-chat-shortcuts, #selection-shortcut-action-panel, #chat-shortcuts-options-panel, #tab-preview-panel, #downloadsPanel)
) ~ #navigator-toolbox #nav-bar,
#mainPopupSet:has(menupopup:hover) ~ #navigator-toolbox #nav-bar,
#mainPopupSet:has(#downloadsPanel:hover) ~ #navigator-toolbox #nav-bar,
:root[window-modal-open] #nav-bar,
#nav-bar[customizing] {
max-height: 600px !important;
/* --urlbar-height (32px) is only the address bar input's own
height, not the full toolbar's real height including padding
(measured at 40px with this CSS fully disabled) */
min-height: 40px !important;
visibility: visible !important;
overflow: visible !important;
transition-delay: 0s !important;
}
/* --- 3d. Bookmarks bar reveal ---
Explicitly excludes the collapsed state (:not([collapsed])) so
Firefox's own "Never Show" setting for the bookmarks toolbar
can't be overridden during hover — without this, hovering would
force an empty, background-colored bar open anyway. A plain
existence check ([collapsed]) is used rather than matching an
exact value, since Firefox's real attribute here doesn't match
[collapsed=""] or [collapsed="true"] directly. */
#navigator-toolbox:hover #PersonalToolbar:not([collapsed]),
#navigator-toolbox:focus-within #PersonalToolbar:not([collapsed]),
#navigator-toolbox[externaldrag] #PersonalToolbar:not([collapsed]),
#navigator-toolbox[forceopen] #PersonalToolbar:not([collapsed]),
#mainPopupSet:has(
> [panelopen]:not(#ask-chat-shortcuts, #selection-shortcut-action-panel, #chat-shortcuts-options-panel, #tab-preview-panel, #downloadsPanel)
) ~ #navigator-toolbox #PersonalToolbar:not([collapsed]),
#mainPopupSet:has(menupopup:hover) ~ #navigator-toolbox #PersonalToolbar:not([collapsed]),
#mainPopupSet:has(#downloadsPanel:hover) ~ #navigator-toolbox #PersonalToolbar:not([collapsed]),
:root[window-modal-open] #navigator-toolbox #PersonalToolbar:not([collapsed]),
#navigator-toolbox #PersonalToolbar[customizing] {
max-height: 600px !important;
visibility: visible !important;
overflow: visible !important;
transition-delay: 0s !important;
}
/* Defensive reset: stops any intermediate wrapper inside the
bookmarks bar from independently capping its own height/overflow
and clipping the multi-row content before it reaches
#PersonalToolbar's own box. */
#navigator-toolbox:hover #PersonalToolbar:not([collapsed]) #PlacesToolbar,
#navigator-toolbox:focus-within #PersonalToolbar:not([collapsed]) #PlacesToolbar,
#navigator-toolbox[externaldrag] #PersonalToolbar:not([collapsed]) #PlacesToolbar,
#navigator-toolbox[forceopen] #PersonalToolbar:not([collapsed]) #PlacesToolbar,
#navigator-toolbox:hover #PersonalToolbar:not([collapsed]) #PlacesToolbar > hbox,
#navigator-toolbox:focus-within #PersonalToolbar:not([collapsed]) #PlacesToolbar > hbox,
#navigator-toolbox[externaldrag] #PersonalToolbar:not([collapsed]) #PlacesToolbar > hbox,
#navigator-toolbox[forceopen] #PersonalToolbar:not([collapsed]) #PlacesToolbar > hbox {
max-height: none !important;
overflow: visible !important;
}
/* --- 3e. Fullscreen: always show all three toolbars ---
While "fullscreen mode" is active (fake-fullscreen.uc.js's toggle,
or real OS-level fullscreen as a safety net - see section 1b), all
three toolbars stay revealed unconditionally for as long as you
stay in fullscreen mode - none of the hover/focus/etc. triggers
above matter here, and moving the mouse away never hides them.
Leaving fullscreen mode (back to windowed mode) removes the
attribute these selectors key off, so windowed mode goes straight
back to the ordinary hover-based auto-hide behavior in 3a-3d,
completely unaffected by this section.
The bookmarks bar still respects Firefox's own "Never Show" setting
(:not([collapsed])), exactly like its ordinary hover-reveal rule in
3d - fullscreen only overrides the auto-hide-on-mouse-away part,
not that choice.
Each selector here matches or exceeds the specificity of every rule
it needs to beat (the shared hidden state in 3a, and the
#navigator-toolbox #PersonalToolbar base max-height reset in
section 4) so it wins regardless of source order. */
:root[data-uc-fakefullscreen="true"] #navigator-toolbox #TabsToolbar,
:root[sizemode="fullscreen"] #navigator-toolbox #TabsToolbar {
max-height: 600px !important;
min-height: var(--tab-min-height, 36px) !important;
visibility: visible !important;
overflow: visible !important;
transition-delay: 0s !important;
}
:root[data-uc-fakefullscreen="true"] #navigator-toolbox #nav-bar,
:root[sizemode="fullscreen"] #navigator-toolbox #nav-bar {
max-height: 600px !important;
min-height: 40px !important;
visibility: visible !important;
overflow: visible !important;
transition-delay: 0s !important;
}
:root[data-uc-fakefullscreen="true"] #navigator-toolbox #PersonalToolbar:not([collapsed]),
:root[sizemode="fullscreen"] #navigator-toolbox #PersonalToolbar:not([collapsed]) {
max-height: 600px !important;
visibility: visible !important;
overflow: visible !important;
transition-delay: 0s !important;
}
/* Same defensive reset as 3d's, so the multi-row bookmarks content
isn't clipped while shown this way (no :hover/:focus-within present
to satisfy 3d's own version of this rule). */
:root[data-uc-fakefullscreen="true"] #navigator-toolbox #PersonalToolbar:not([collapsed]) #PlacesToolbar,
:root[sizemode="fullscreen"] #navigator-toolbox #PersonalToolbar:not([collapsed]) #PlacesToolbar,
:root[data-uc-fakefullscreen="true"] #navigator-toolbox #PersonalToolbar:not([collapsed]) #PlacesToolbar > hbox,
:root[sizemode="fullscreen"] #navigator-toolbox #PersonalToolbar:not([collapsed]) #PlacesToolbar > hbox {
max-height: none !important;
overflow: visible !important;
}
/* ----------------------------------------------------------------
4. BOOKMARKS TOOLBAR SPECIFICS
---------------------------------------------------------------- */
/* Preserve Firefox's own explicit "collapse bookmarks bar" state
(right-click > Bookmarks Toolbar > Never Show) — stays fully
hidden regardless of hover, in both fullscreen and windowed mode.
Fullscreen is deliberately NOT special-cased here (it used to be,
forcing the bar hidden even with "Always Show" set): tabs and the
nav-bar never got that treatment and already reveal in fullscreen
exactly like windowed mode via the same hover/forceopen rules
above, so the bookmarks bar now matches them instead of being the
one inconsistent toolbar. */
#PersonalToolbar:is([collapsed]) {
max-height: 0 !important;
visibility: hidden !important;
}
/* Beats multi-row_bookmarks.css's own plain
#PersonalToolbar{max-height:none} rule (section 7 below), which
otherwise ties in specificity and wins by source order. */
#navigator-toolbox #PersonalToolbar {
max-height: 0 !important;
}
#PersonalToolbar:is([collapsed]) #PlacesToolbarItems > * {
visibility: hidden !important;
}
#PlacesToolbarItems > .bookmark-item,
#OtherBookmarks,
#PersonalToolbar > #import-button {
padding-block: var(--uc-bm-padding) !important;
}
/* Outline an expanded bookmarks-toolbar folder (or nested folder) using
currentColor, so the outline automatically matches the folder's own
label text color under any theme, without hardcoding a value. Uses
outline (not border) so it doesn't shift the button's own layout size,
and a negative outline-offset so it sits just inside the button's edge
rather than outside it. Reverts to normal automatically once
inline-bookmark-folders.uc.js removes the data-bmif-expanded attribute
on collapse. Applies to nested folders too, since they share the same
.bookmark-item class and attribute. */
.bookmark-item[data-bmif-expanded="true"] {
outline: 1px solid currentColor !important;
outline-offset: -1px !important;
}
/* Suppresses Firefox's own native "potential drop target" highlight
(a blue background) that appears on a folder while a bookmark is
being dragged over it - purely visual native widget rendering,
unrelated to whether the drop is actually allowed (which is
separately blocked in inline-bookmark-folders.uc.js). Uses the same
data-bmif-drag-hover attribute that script sets during this exact
state. -moz-appearance is reset too since native widget rendering can
otherwise ignore a plain background-color override, as seen elsewhere
in this file. */
.bookmark-item[data-bmif-drag-hover="true"] {
-moz-appearance: none !important;
background-color: transparent !important;
background-image: none !important;
color: inherit !important;
fill: currentColor !important;
}
/* Dims a folder button while it's being manually dragged (see
inline-bookmark-folders.uc.js's handleManualFolderDragMove/End) -
folder reordering doesn't use native HTML5 drag-and-drop, so there's
no automatic translucent drag image; this gives the same "something is
being picked up" feedback by hand instead. */
.bookmark-item[data-bmif-manual-dragging="true"] {
opacity: 0.4 !important;
}
/* Forces the whole window's cursor to reflect whether the current mouse
position is a legal drop spot during a manual folder drag (set/cleared
by inline-bookmark-folders.uc.js's setManualDragCursor) - targets every
element with !important since whatever's under the cursor at any given
moment may otherwise carry its own more specific cursor styling. */
:root[data-bmif-drag-cursor="forbidden"],
:root[data-bmif-drag-cursor="forbidden"] * {
cursor: not-allowed !important;
}
:root[data-bmif-drag-cursor="grabbing"],
:root[data-bmif-drag-cursor="grabbing"] * {
cursor: grabbing !important;
}
/* Highlights a folder while a dragged bookmark is hovering directly over
its icon (as opposed to a specific position among its contents), to
show it as a valid "drop here to file into this folder" target - set/
cleared by inline-bookmark-folders.uc.js's folder-icon drop handler. */
.bookmark-item[data-bmif-drop-into="true"] {
outline: 2px dashed currentColor !important;
outline-offset: -2px !important;
}
/* Within-folder drag reordering reuses Firefox's own native drop
indicator element directly (positioned via script in
inline-bookmark-folders.uc.js) rather than a custom CSS indicator, so
it looks identical to ordinary bookmark reordering. No CSS needed
here. */
/* FIX: Firefox's toolbars treat empty/blank space as a window-drag handle
by default (that's how you normally move the window by grabbing blank
toolbar area) — interactive elements like buttons are automatically
excluded from this, but the bookmarks bar's own scrollbar (a native
widget, not a normal button) apparently isn't recognized the same way,
so click-dragging it was moving the whole window instead of scrolling.
This explicitly excludes the entire bookmarks content area (including
its scrollbar) from window-dragging regardless of Firefox's own
default heuristics for that region. */
#PlacesToolbarItems {
-moz-window-dragging: no-drag !important;
}
/* ----------------------------------------------------------------
4b. HIDE NATIVE "OPEN IN NEW CONTAINER TAB"
Removed from our own custom folder-item menu (inline-bookmark-
folders.uc.js) after ContextualIdentityService's module import
consistently failed to load in that script for unresolved reasons.
Hidden here from Firefox's native placesContext menu too, so
regular (non-folder) bookmarks match - confirmed working CSS from
a real community report (Mozilla Connect), not just theoretical.
---------------------------------------------------------------- */
menu[id="placesContext_open:newcontainertab"] {
display: none !important;
}
/* ----------------------------------------------------------------
4c. HIDE NATIVE "CUT/COPY/PASTE" ON TOP-LEVEL BOOKMARKS/FOLDERS/
SEPARATORS
Removed from our own custom folder-item menu (inline-bookmark-
folders.uc.js) by request. Hidden here too from Firefox's native
placesContext menu, so top-level (non-folder) items match. Real,
current ids confirmed directly from Firefox's own source
(placesContextMenu.inc.xhtml): the three items sit between
placesContext_deleteSeparator and placesContext_editSeparator -
removing the items plus the leading separator (matching what was
done in the custom menu) leaves a single divider between the
Delete/Sort section and the Add Bookmark/Folder/Separator section,
rather than two in a row or none at all.
---------------------------------------------------------------- */
menuseparator[id="placesContext_deleteSeparator"],
menuitem[id="placesContext_cut"],
menuitem[id="placesContext_copy"],
menuitem[id="placesContext_paste_group"] {
display: none !important;
}
/* ----------------------------------------------------------------
5. TAB LABEL SIZING
Keeps tab row height consistent now that #TabsToolbar's own
height is controlled directly (section 3b) rather than via a
parent's margin.
---------------------------------------------------------------- */
#tabbrowser-tabs:not([secondarytext-unsupported]) .tab-label-container {
max-height: var(--tab-min-height);
}
.tab-label {
line-height: 20px !important;
}
:root[uidensity="compact"] .tab-label {
line-height: 18px !important;
}
/* ----------------------------------------------------------------
6. ADDRESS/SEARCH BAR DROPDOWN FIX
Firefox sets --urlbar-container-height directly on the container
element via inline style, and several of Firefox's own native
rules (min-height, the suggestions dropdown's padding, and its
vertical position) all calculate off this one variable. With a
custom toolbar height toggling like this file's, Firefox measures
it incorrectly (observed as low as 8px), corrupting every
downstream formula built on top of it. Overriding the variable
itself, at its source, lets every native formula that reads it
use the corrected value automatically.
Targets the shared .urlbar-container CLASS (matching Firefox's
own native rule) rather than a specific ID, since both the
address bar (#urlbar-container) and the search bar
(#search-container) carry this class and the same bug.
---------------------------------------------------------------- */
.urlbar-container {
--urlbar-container-height: 40px !important;
}
/* ================================================================
7. MULTI-ROW BOOKMARKS BAR (third-party, unchanged)
Source: https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/multi-row_bookmarks.css
Made available under Mozilla Public License v. 2.0
================================================================ */
#PersonalToolbar {
--multirow-bmb-n-rows: 10;
--multirow-bmb-row-margin: 2px;
max-height: none !important;
}
:root[BookmarksToolbarOverlapsBrowser] :where(#PersonalToolbar) {
height: unset !important;
}
#PlacesToolbar > hbox:not(#PlacesToolbarDropIndicatorHolder) {
display: block;
width: 100vw;
}
#PlacesToolbarItems {
display: flex;
flex-wrap: wrap;
max-height: calc(
var(--multirow-bmb-n-rows) *
(4px + 1em + (2 * (var(--multirow-bmb-row-margin) + var(--uc-bm-padding, var(--bookmark-block-padding)))))
) !important;
overflow-y: auto;
scrollbar-color: var(--lwt-accent-color, var(--toolbox-background-color, var(--toolbox-bgcolor)))
var(--toolbar-background-color, var(--toolbar-bgcolor));
scrollbar-gutter: stable;
scrollbar-width: thin;
}
#PlacesChevron {
display: none;
}
#PlacesToolbarItems > .bookmark-item {
margin: var(--multirow-bmb-row-margin) 0 !important;
border-inline: 2px solid transparent;
visibility: visible !important;
}