From f2393b07c2dbf2c06c6e5c0cf12c2362c14b5918 Mon Sep 17 00:00:00 2001 From: Nydragon Date: Sat, 21 Dec 2024 17:16:09 +0100 Subject: [PATCH] feat: auto hide sidebar userchrome and add language packs --- home/graphical/firefox/default.nix | 83 ++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 11 deletions(-) diff --git a/home/graphical/firefox/default.nix b/home/graphical/firefox/default.nix index e44378a..7e8bddc 100644 --- a/home/graphical/firefox/default.nix +++ b/home/graphical/firefox/default.nix @@ -10,20 +10,81 @@ lib.mkIf osConfig.programs.firefox.enable { enable = true; # Installed by nixpkgs module package = null; + languagePacks = [ + "de" + "en-GB" + "fr" + ]; profiles.${config.home.username} = { name = config.home.username; isDefault = true; - userChrome = '' - /* Hides the native tabs */ - #TabsToolbar { - visibility: collapse; - } - /* Fixed width for the sidebar */ - #sidebar-box { - max-width: 17.5% !important; - min-width: 17.5% !important; - } - ''; + userContent = # css + '' + // Sidebery + @-moz-document url("moz-extension://d1d9847c-2bad-429f-9366-56db49b8c3d6/sidebar/sidebar.html") + { + #root { + --tabs-indent: 0px !important; + } + + #root:hover { + --tabs-indent: 30px !important; + } + } + ''; + userChrome = # css + '' + /* Hides the native tabs, sidebar header and splitter */ + #TabsToolbar, + #sidebar-splitter, + #sidebar-header { + display: none; + } + + #sidebar-box { + --sidebar-normal-width: 35px; + --sidebar-hovered-width: 300px; + --sidebar-transition-speed: 200ms; + --sidebar-collapse-delay: 300ms; + --sidebar-transition-type: linear; + --browser-area-z-index-sidebar: 3; + + position: relative; + min-width: var(--sidebar-normal-width) !important; + width: var(--sidebar-normal-width) !important; + max-width: var(--sidebar-normal-width) !important; + z-index: var(--browser-area-z-index-sidebar); + } + + #sidebar-box[positionend] { + direction: rtl; + } + #sidebar-box[positionend] > * { + direction: ltr; + } + + #sidebar-box[positionend]:-moz-locale-dir(rtl) { + direction: ltr; + } + #sidebar-box[positionend]:-moz-locale-dir(rtl) > * { + direction: rtl; + } + + #main-window[sizemode="fullscreen"] #sidebar-box { + --sidebar-normal-width: 1px; + } + + #sidebar { + transition: min-width var(--sidebar-transition-speed) + var(--sidebar-transition-type) var(--sidebar-collapse-delay) !important; + min-width: var(--sidebar-normal-width) !important; + will-change: min-width; + } + #sidebar-box:hover > #sidebar { + min-width: var(--sidebar-hovered-width) !important; + transition-delay: 20ms !important; + } + ''; search = { default = "DuckDuckGo"; force = true;