Minsky_01

Floating URL bar v1.1

Mar 18th, 2025 (edited)
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 6.21 KB | Source Code | 0 0
  1. /* ─────────────── Zen UI Tweaks ─────────────── */
  2.  
  3. /* Define shared design tokens for consistency and reuse */
  4. :root {
  5.   --zen-dark-bg: rgba(31, 31, 31, 1);       /* Dark background used across UI */
  6.   --zen-light-text: rgba(242, 239, 228, 1); /* Light foreground text color */
  7.   --zen-highlight: rgba(31, 31, 31, 1);     /* Highlight color (same as dark background) */
  8.   --zen-accent: rgba(247, 111, 83, 1);      /* Accent color for emphasis (e.g. borders) */
  9.   --border-radius: 8px;                     /* Rounded corner radius for UI elements */
  10. }
  11.  
  12. /* Override global Firefox variables for Zen theme */
  13. * {
  14.   --urlbarView-highlight-background: var(--zen-light-text) !important;
  15.   --toolbar-field-focus-color: var(--zen-light-text) !important;
  16.   --urlbarView-highlight-color: var(--zen-highlight) !important;
  17.   --toolbar-field-color: var(--zen-light-text) !important;
  18.   --zen-branding-bg-reverse: transparent !important;
  19. }
  20.  
  21. /* Apply Zen UI styles only in normal browsing mode (not customizing, full-screen, etc.) */
  22.   :root[zen-compact-mode="true"]:not([customizing]):not([inDOMFullscreen="true"]):not([zen-single-toolbar="true"]) {
  23.  
  24.     /* ─── URL Bar View Tweaks ─── */
  25.  
  26.     /* Hide URL path from suggestion rows */
  27.     span.urlbarView-url {
  28.       display: none !important;
  29.     }
  30.  
  31.     /* Highlight row background and text color on hover */
  32.     .urlbarView-row:hover {
  33.       background-color: var(--zen-light-text) !important;
  34.       color: var(--zen-dark-bg) !important;
  35.     }
  36.  
  37.     /* Remove separator and action labels like “- Search with Google” */
  38.     span.urlbarView-action,
  39.     span.urlbarView-title-separator {
  40.       display: none !important;
  41.     }
  42.  
  43.     /* ─── Tab Strip and Sidebar Cleanups ─── */
  44.  
  45.     /* Remove tab close buttons for a minimal tab strip */
  46.     .tab-close-button {
  47.       display: none !important;
  48.     }
  49.  
  50.     /* Hide the “Extension” label in the URL bar */
  51.     box#identity-icon-box {
  52.       display: none !important;
  53.     }
  54.  
  55.     /* ─── Navbar Styling and Layout ─── */
  56.  
  57.     /* Prevent navbar from showing on side-hover by positioning and hiding it */
  58.     #zen-appcontent-navbar-container {
  59.       box-shadow: unset !important;
  60.       background: transparent !important;
  61.       border: unset !important;
  62.       position: absolute !important;
  63.       width: 45% !important;
  64.       left: 50% !important;
  65.       transform: translateX(-50%) !important;
  66.       z-index: 10 !important;
  67.     }
  68.  
  69.     /* Shift navbar further out of view to fully hide it */
  70.     #zen-appcontent-navbar-container {
  71.       --zen-element-separation: -5px !important;
  72.     }
  73.  
  74.     /* Style the main navigation toolbar */
  75.     toolbar#nav-bar {
  76.       width: 100%;
  77.       top: 1vh !important;
  78.       background: var(--zen-dark-bg) !important;
  79.       box-shadow: var(--zen-big-shadow) !important;
  80.       border: 0 solid var(--zen-dark-bg) !important;
  81.       border-radius: var(--border-radius) !important;
  82.     }
  83.  
  84.     /* Center the URL bar within the toolbar */
  85.     #urlbar {
  86.       left: 50% !important;
  87.       transform: translateX(-50%) !important;
  88.     }
  89.  
  90.     /* Style placeholder text for both search bar and URL bar */
  91.     .urlbar-input::placeholder,
  92.     .searchbar-textbox::placeholder {
  93.       color: var(--zen-light-text) !important;
  94.     }
  95.  
  96.     /* Collapse URL bar when download or extension buttons are shown */
  97.     #urlbar-container {
  98.       #nav-bar:is([downloadsbuttonshown], [unifiedextensionsbuttonshown]) & {
  99.         width: 0 !important;
  100.       }
  101.     }
  102.  
  103.     /* Remove transition and background for unfocused URL bar */
  104.     #urlbar:not([breakout-extend="true"]) #urlbar-background {
  105.       transition: unset !important;
  106.       background: transparent !important;
  107.     }
  108.  
  109.     /* Set background when URL bar enters breakout (focused/expanded) state */
  110.     #urlbar[breakout][breakout-extend] #urlbar-background {
  111.       background: rgba(31, 31, 31, 0.9) !important;
  112.     }
  113.  
  114.     /* Center URL bar text */
  115.     #urlbar-container {
  116.       text-align: center;
  117.     }
  118.  
  119.     /* Set consistent text color in and outside breakout state */
  120.     #urlbar,
  121.     #urlbar[breakout][breakout-extend] {
  122.       color: var(--zen-light-text) !important;
  123.     }
  124.  
  125.     /* ─── Sidebar and Titlebar Styling ─── */
  126.  
  127.     /* Center the entire top toolbar horizontally */
  128.     toolbox#navigator-toolbox {
  129.       justify-content: center !important;
  130.     }
  131.  
  132.     /* Style the titlebar background and height */
  133.     hbox#titlebar {
  134.       height: 75% !important;
  135.       background: var(--zen-dark-bg) !important;
  136.       border: unset !important;
  137.     }
  138.  
  139.     /* Apply border radius to titlebar in compact Zen mode */
  140.     :root[zen-compact-mode="true"]:not([customizing]):not([inDOMFullscreen="true"])
  141.     #navigator-toolbox:not([animate="true"]) #titlebar {
  142.       border-radius: var(--border-radius) !important;
  143.     }
  144.  
  145.     /* Transparent background and rounded corners for sidebar tabs */
  146.     vbox.tab-background {
  147.       background: transparent !important;
  148.       border-radius: var(--border-radius) !important;
  149.     }
  150.  
  151.     /* Highlight active or multi-selected tabs with Zen accent color */
  152.     .tab-content {
  153.       &:is([selected], [multiselected]) {
  154.         border-left: 2px solid var(--zen-accent);
  155.       }
  156.     }
  157.  
  158.     /* ─── Misc Buttons and Icons ─── */
  159.  
  160.     /* Fine-tune menu button alignment */
  161.     #PanelUI-menu-button {
  162.       padding-inline-end: 0px !important;
  163.       margin-left: -5px !important;
  164.     }
  165.  
  166.     /* Apply accent color to Zen menu button icon */
  167.     .toolbarbutton-icon[label="Zen"] {
  168.       fill: var(--zen-accent) !important;
  169.     }
  170.  
  171.     /* De-emphasize starred bookmark icon */
  172.     #star-button[starred] {
  173.       fill-opacity: 0.4 !important;
  174.       fill: var(--toolbarbutton-icon-fill) !important;
  175.     }
  176.  
  177.     /* Hide UI elements to simplify the interface */
  178.     #reader-mode-button,
  179.     #translations-button,
  180.     #identity-box,
  181.     #identity-permission-box,
  182.     #star-button-box,
  183.     #picture-in-picture-button,
  184.     #PersonalToolbar {
  185.       display: none !important;
  186.     }
  187.  
  188.     /* Prevent collapse of customization panel */
  189.     #customization-panel-container {
  190.       width: 20% !important;
  191.     }
  192.   }
Advertisement
Add Comment
Please, Sign In to add comment