home-manager/firefox: better sidebar

This commit is contained in:
xinyangli 2024-08-25 16:30:22 +08:00
parent a2422d1f4e
commit 6120ca25fb
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
2 changed files with 82 additions and 8 deletions

View file

@ -47,14 +47,15 @@
custom-hm = {
alacritty = { enable = true; };
direnv = { enable = true; };
fish = { enable = true; };
git = { enable = true; signing.enable = true; };
cosmic-term = { enable = true; };
direnv = { enable = true; }; fish = { enable = true; }; git = { enable = true; signing.enable = true; };
neovim = { enable = true; };
vscode = { enable = true; languages = { cxx = true; python = true; scala = true; latex = true; }; llm = true; };
zellij = { enable = true; };
};
programs.gnome-shell.enable = true;
programs.atuin = {
enable = true;
flags = [ "--disable-up-arrow" ];
@ -68,10 +69,82 @@
programs.firefox.profiles.default = {
isDefault = true;
userChrome = builtins.readFile "${pkgs.fetchgit {
url = "https://gist.github.com/0ded98af9fe3da35f3688f81364d8c14.git";
rev = "11bb4f428382052bcbbceb6cc3fef97f3c939481";
hash = "sha256-J11indzEGdUA0HSW8eFe5AjesOxCL/G05KwkJk9GZSY=";
}}/userChrome.css";
userChrome = ''
#titlebar {
display: none;
}
#sidebar-header {
display: none;
}
[titlepreface*="."] #sidebar-header {
visibility: collapse !important;
}
[titlepreface*="."] #titlebar {
visibility: collapse;
}
#sidebar-box{
--uc-sidebar-width: 33px;
--uc-sidebar-hover-width: 300px;
--uc-autohide-sidebar-delay: 90ms;
position: relative;
min-width: var(--uc-sidebar-width) !important;
width: var(--uc-sidebar-width) !important;
max-width: var(--uc-sidebar-width) !important;
z-index:1;
}
#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{ --uc-sidebar-width: 1px; }
#sidebar-splitter{ display: none }
#sidebar-header{
overflow: hidden;
color: var(--chrome-color, inherit) !important;
padding-inline: 0 !important;
}
#sidebar-header::before,
#sidebar-header::after{
content: "";
display: -moz-box;
padding-left: 8px;
}
#sidebar-switcher-target{
-moz-box-pack: start !important;
}
#sidebar-header,
#sidebar{
transition: min-width 115ms linear var(--uc-autohide-sidebar-delay) !important;
min-width: var(--uc-sidebar-width) !important;
will-change: min-width;
}
#sidebar-box:hover > #sidebar-header,
#sidebar-box:hover > #sidebar{
min-width: var(--uc-sidebar-hover-width) !important;
transition-delay: 0ms !important;
}
.sidebar-panel{
background-color: transparent !important;
color: var(--newtab-text-primary-color) !important;
}
.sidebar-panel #search-box{
-moz-appearance: none !important;
background-color: rgba(249,249,250,0.1) !important;
color: inherit !important;
}
'';
};
}

View file

@ -25,6 +25,7 @@ in
window = {
resize_increments = true;
dynamic_padding = true;
decorations = "none";
};
};
};