tab numbers are replaced by close button on hover

This commit is contained in:
philmard 2025-01-20 18:44:24 +02:00
parent dcbff62ade
commit b12193fb51
3 changed files with 147 additions and 154 deletions

View file

@ -1,22 +1,17 @@
@-moz-document url-prefix("chrome:") {
tabs { tabs {
counter-reset: tab-counter; counter-reset: tab-counter;
} } /* Automatically increment tab numbers for each .tab-content inside a tab */ /* Styles when the sidebar is expanded */
/* Automatically increment tab numbers for each .tab-content inside a tab */
/* Styles when the sidebar is expanded */
@media (-moz-bool-pref: "zen.view.sidebar-expanded") { @media (-moz-bool-pref: "zen.view.sidebar-expanded") {
tab .tab-content::after { tab .tab-content::after {
counter-increment: tab-counter; counter-increment: tab-counter;
content: counter(tab-counter); /* Space before the number */ content: counter(
tab-counter
/* Positioning and styling */ ); /* Space before the number */ /* Positioning and styling */
font-weight: var(--bold-text, normal); font-weight: var(--bold-text, normal);
font-size: var(--font_size, 80%); font-size: var(--font_size, 80%);
color: var(--number_color, inherit); color: var(--number_color, inherit);
z-index: -100; z-index: -100; /* Background and shape for the number */
/* Background and shape for the number */
display: inline-block; display: inline-block;
background-color: var( background-color: var(
--number_background_color, --number_background_color,
@ -31,25 +26,46 @@ tabs {
20% 20%
); /* Default for Slightly Rounded Square */ ); /* Default for Slightly Rounded Square */
margin-left: 3px; margin-left: 3px;
margin-right: 5px; margin-right: 3px; /* Changed to 3px to align with the Close Button */
} }
/* Hide the "X" close button by default */
tab .tab-close-button {
visibility: hidden;
opacity: 0;
/* In order to not hide the tab title. [Can't make this work. It still hides the title] */
/* Also, display: none; doesn't seem to work */
width: 0;
margin: 0;
}
/* Hide tab numbers on the right side when hovering over */
tab .tab-content:hover::after {
opacity: 0; /* Make it invisible */
width: 0; /* In order to bring the close button to the right */
margin: 0;
}
/* Show the "X" close button on hover */
tab:hover .tab-close-button {
visibility: visible;
opacity: 1;
}
/* put tab numbers on the left side when expanded_side="Left" (AND in expanded mode) */ /* put tab numbers on the left side when expanded_side="Left" (AND in expanded mode) */
:root:has(#theme-Tab-Numbers[uc-theme-expanded_side="Left"]) { :root:has(#theme-Tab-Numbers[uc-theme-expanded_side="Left"]) {
tab .tab-content::after { tab .tab-content::after {
display: none; /* Hide the ::after pseudo-element first */ display: none; /* Hide the ::after pseudo-element first */
} }
tab .tab-content::before { tab .tab-content::before {
counter-increment: tab-counter; counter-increment: tab-counter;
content: counter(tab-counter); /* Space before the number */ content: counter(
tab-counter
/* Positioning and styling */ ); /* Space before the number */ /* Positioning and styling */
font-weight: var(--bold-text, normal); font-weight: var(--bold-text, normal);
font-size: var(--font_size, 80%); font-size: var(--font_size, 80%);
color: var(--number_color, inherit); color: var(--number_color, inherit);
z-index: -100; z-index: -100; /* Background and shape for the number */
/* Background and shape for the number */
display: inline-block; display: inline-block;
background-color: var( background-color: var(
--number_background_color, --number_background_color,
@ -67,36 +83,32 @@ tabs {
margin-right: 5px; margin-right: 5px;
} }
} }
} } /* Styles when the sidebar is NOT expanded (compact mode) */
/* Styles when the sidebar is NOT expanded (compact mode) */
@media not (-moz-bool-pref: "zen.view.sidebar-expanded") { @media not (-moz-bool-pref: "zen.view.sidebar-expanded") {
tab .tab-content::before { tab .tab-content::before {
counter-increment: tab-counter; counter-increment: tab-counter;
content: counter(tab-counter) ""; content: counter(tab-counter) "";
position: absolute; position: absolute;
top: 4px; top: 4px;
right: 1px; right: 1px;
padding: 0px 0px; padding: 0px 0px;
z-index: -100; z-index: -100;
font-weight: var(--bold-text, normal); font-weight: var(--bold-text, normal);
font-size: var(--font_size, 80%); /* Default font size (same as "Small") */ font-size: var(
--font_size,
80%
); /* Default font size (same as "Small") */
color: var(--number_color, inherit); /* Fallback to default color */ color: var(--number_color, inherit); /* Fallback to default color */
} } /* put tab numbers on the left side when compact_side="Left" (AND in compact mode) */
/* put tab numbers on the left side when compact_side="Left" (AND in compact mode) */
:root:has(#theme-Tab-Numbers[uc-theme-compact_side="Left"]) { :root:has(#theme-Tab-Numbers[uc-theme-compact_side="Left"]) {
tab .tab-content::before { tab .tab-content::before {
counter-increment: tab-counter; counter-increment: tab-counter;
content: counter(tab-counter) ""; content: counter(tab-counter) "";
position: absolute; position: absolute;
top: 4px; top: 4px;
left: 1px; left: 1px;
padding: 0px 0px; padding: 0px 0px;
z-index: -100; z-index: -100;
font-weight: var(--bold-text, normal); font-weight: var(--bold-text, normal);
font-size: var( font-size: var(
--font_size, --font_size,
@ -105,15 +117,12 @@ tabs {
color: var(--number_color, inherit); /* Fallback to default color */ color: var(--number_color, inherit); /* Fallback to default color */
} }
} }
} } /* Enable bold text when the preference is enabled */
/* Enable bold text when the preference is enabled */
@media (-moz-bool-pref: "uc.theme.bold-text-enable.enabled") { @media (-moz-bool-pref: "uc.theme.bold-text-enable.enabled") {
tab .tab-content { tab .tab-content {
--bold-text: bold; --bold-text: bold;
} }
} }
@media (-moz-bool-pref: "uc.theme.custom_color_enabled") { @media (-moz-bool-pref: "uc.theme.custom_color_enabled") {
tab .tab-content { tab .tab-content {
--number_color: var(--uc-theme-number_color) !important; --number_color: var(--uc-theme-number_color) !important;
@ -121,56 +130,38 @@ tabs {
--uc-theme-number_background_color --uc-theme-number_background_color
) !important; ) !important;
} }
} } /* Set font size for Extra Small (Override default) */
/* Set font size for Extra Small (Override default) */
:root:has(#theme-Tab-Numbers[uc-theme-font_size="XSmall"]) { :root:has(#theme-Tab-Numbers[uc-theme-font_size="XSmall"]) {
--font_size: 70% !important; /* Extra Small font size */ --font_size: 70% !important; /* Extra Small font size */
} } /* Set font size for Small */
/* Set font size for Small */
:root:has(#theme-Tab-Numbers[uc-theme-font_size="Small"]) { :root:has(#theme-Tab-Numbers[uc-theme-font_size="Small"]) {
--font_size: 80% !important; /* Small font size */ --font_size: 80% !important; /* Small font size */
} } /* Set font size for Medium (Override default) */
/* Set font size for Medium (Override default) */
:root:has(#theme-Tab-Numbers[uc-theme-font_size="Medium"]) { :root:has(#theme-Tab-Numbers[uc-theme-font_size="Medium"]) {
--font_size: 90% !important; /* Medium font size */ --font_size: 90% !important; /* Medium font size */
} } /* Set font size for Large (Override default) */
/* Set font size for Large (Override default) */
:root:has(#theme-Tab-Numbers[uc-theme-font_size="Large"]) { :root:has(#theme-Tab-Numbers[uc-theme-font_size="Large"]) {
--font_size: 100% !important; /* Large font size */ --font_size: 100% !important; /* Large font size */
} } /* Set font size for Extra Large (Override default) */
/* Set font size for Extra Large (Override default) */
:root:has(#theme-Tab-Numbers[uc-theme-font_size="XLarge"]) { :root:has(#theme-Tab-Numbers[uc-theme-font_size="XLarge"]) {
--font_size: 120% !important; /* Extra Large font size */ --font_size: 120% !important; /* Extra Large font size */
} } /* Ensure Close X button is on top of everything. */
/* Ensure Close X button is on top of everything. */
.tab-close-button { .tab-close-button {
z-index: 10; z-index: 10;
} } /* Customize the shape based on the preference values */
/* Customize the shape based on the preference values */
:root:has(#theme-Tab-Numbers[uc-theme-background_shape="Square"]) { :root:has(#theme-Tab-Numbers[uc-theme-background_shape="Square"]) {
--background_shape: 0%; /* Square */ --background_shape: 0%; /* Square */
} }
:root:has(#theme-Tab-Numbers[uc-theme-background_shape="SlightlyRounded"]) { :root:has(#theme-Tab-Numbers[uc-theme-background_shape="SlightlyRounded"]) {
--background_shape: 5%; /* Slightly Rounded Square */ --background_shape: 5%; /* Slightly Rounded Square */
} }
:root:has(#theme-Tab-Numbers[uc-theme-background_shape="ModeratelyRounded"]) { :root:has(#theme-Tab-Numbers[uc-theme-background_shape="ModeratelyRounded"]) {
--background_shape: 15%; /* Moderately Rounded Square */ --background_shape: 15%; /* Moderately Rounded Square */
} }
:root:has(#theme-Tab-Numbers[uc-theme-background_shape="FullyRounded"]) { :root:has(#theme-Tab-Numbers[uc-theme-background_shape="FullyRounded"]) {
--background_shape: 30%; /* Fully Rounded Square */ --background_shape: 30%; /* Fully Rounded Square */
} }
:root:has(#theme-Tab-Numbers[uc-theme-background_shape="Circle"]) { :root:has(#theme-Tab-Numbers[uc-theme-background_shape="Circle"]) {
--background_shape: 50%; /* Perfect Circle */ --background_shape: 50%; /* Perfect Circle */
} }
}

View file

@ -2,6 +2,10 @@
Shows the Number corresponding to each Tab. This can help you navigate between Tabs faster by pressing Cmd + Number of the Tab. (or Ctrl + Number on Windows) Shows the Number corresponding to each Tab. This can help you navigate between Tabs faster by pressing Cmd + Number of the Tab. (or Ctrl + Number on Windows)
Additions (v1.0.4 - current version):
- Tab Numbers are replaced with Close button on Hover (in Expanded Mode)
Additions (v1.0.3 - current version): Additions (v1.0.3 - current version):
- Nicer Design for Expanded Tabs Mode - Nicer Design for Expanded Tabs Mode

View file

@ -7,11 +7,9 @@
"readme": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/22c9ec3b-7c62-46ae-991f-c8fff5046829/readme.md", "readme": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/22c9ec3b-7c62-46ae-991f-c8fff5046829/readme.md",
"image": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/22c9ec3b-7c62-46ae-991f-c8fff5046829/image.png", "image": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/22c9ec3b-7c62-46ae-991f-c8fff5046829/image.png",
"author": "philmard", "author": "philmard",
"version": "1.0.3", "version": "1.0.4",
"preferences": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/22c9ec3b-7c62-46ae-991f-c8fff5046829/preferences.json", "preferences": "https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/22c9ec3b-7c62-46ae-991f-c8fff5046829/preferences.json",
"tags": [ "tags": ["tabs"],
"tabs"
],
"createdAt": "2024-11-09", "createdAt": "2024-11-09",
"updatedAt": "2024-12-22" "updatedAt": "2024-12-22"
} }