Skip to content

Commit

Permalink
Move hide-tabs-bar tweak to new file
Browse files Browse the repository at this point in the history
  • Loading branch information
bmFtZQ committed Jan 6, 2024
1 parent 773deab commit c22c72e
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 3 deletions.
89 changes: 89 additions & 0 deletions chrome/tweaks/hide-tabs-bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/* Edge-Frfox - tweaks/hide-tabs-bar.css
* https://github.com/bmFtZQ/edge-frfox */

:root:not([customizing]) {
/* Height of navbar, used for determining height and position of window controls */
--uc-navbar-height: 38px;
/* Drag space next to the window controls, allows you to move the window more easily */
--uc-titlebar-drag-space: 40px;

@media not (-moz-bool-pref: "uc.tweak.hide-tabs-bar.only-when-maximised") {
/* Hide the tabs */
& #TabsToolbar {
visibility: collapse !important;
}

/* Add some padding to the top of the navbar */
&[tabsintitlebar] #nav-bar {
padding-top: var(--uc-tab-top-margin, 0) !important;
}
}

/* macOS specific positioning */
@media (-moz-platform: macos) {
&[inFullscreen] {
/* Hide the tabs */
& #TabsToolbar {
visibility: collapse !important;
}
}

@media not (-moz-bool-pref: "uc.tweak.hide-tabs-bar.only-when-maximised") {
/* Offset navbar contents to make space for the window controls */
&[tabsintitlebar] #nav-bar:not([inFullscreen]) {
padding-left: calc(70px + var(--uc-titlebar-drag-space)) !important;

/* Remove the padding from the side of the navbar */
& #nav-bar-customization-target > :is(toolbarbutton, toolbaritem):first-child {
padding-inline-start: 0 !important;
}
}

/* Positioning of the window controls */
#TabsToolbar .titlebar-buttonbox-container {
visibility: visible !important;
position: fixed !important;
height: calc(var(--uc-navbar-height) + var(--uc-tab-top-margin, 0px));
margin: 0 !important;
top: 0;
left: 0;

& .titlebar-buttonbox {
margin-inline: calc((var(--uc-navbar-height) + var(--uc-tab-top-margin, 0px) - 14px) / 2) !important;
}
}
}
}

/* Windows specific positioning */
@media (-moz-platform: windows) {
/* Offset navbar contents to make space for the window controls */
&:where([inFullscreen], [tabsintitlebar]) #nav-bar {
padding-right: calc(140px + var(--uc-titlebar-drag-space)) !important;

/* Remove the padding from the side of the navbar */
& #PanelUI-menu-button {
padding-inline-end: 0 !important;
}
}

/* Positioning of the window controls */
& #toolbar-menubar[inactive] + #TabsToolbar .titlebar-buttonbox {
visibility: visible !important;
position: fixed !important;
top: 0;
right: 0;
height: calc(var(--uc-navbar-height) + var(--uc-tab-top-margin, 0)) !important;
z-index: 3 !important;
color: var(--toolbar-color) !important;
}

/* Set background colour of the menu bar to maintain consistency with the navbar */
@media not (-moz-bool-pref: "uc.tweak.floating-tabs") {
#toolbar-menubar {
background-color: var(--toolbar-bgcolor) !important;
color: var(--toolbar-color) !important;
}
}
}
}
9 changes: 6 additions & 3 deletions chrome/userChrome.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Edge-Frfox */
/* Edge-Frfox main files */
@import url("icons/icons.css");
@import url("toolbar/tabbar.css");
@import url("toolbar/navbar.css");
Expand All @@ -7,9 +7,12 @@
@import url("toolbar/urlbar.css");
@import url("global/colors.css");
@import url("global/popup.css");
@import url("global/tweaks.css");
@import url("global/browser.css");
@import url("global/tree.css");

/* import custom stylesheet instead of modifying Edge-Frfox theme files */
/* Edge-Frfox tweaks */
@import url("global/tweaks.css");
@import url("tweaks/hide-tabs-bar.css") (-moz-bool-pref: "uc.tweak.hide-tabs-bar");

/* Import custom stylesheet instead of modifying Edge-Frfox theme files. */
@import url("custom.css");

0 comments on commit c22c72e

Please sign in to comment.