Repository navigation
gh-15785: Fix right-sidebar gradient shifts in compact mode #15961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mr-cheffy
merged 4 commits into
zen-browser:dev
from
yosofbadr:fix/compact-gradient-right
Oct 15, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d775869
gh-15785: Keep right sidebar gradients aligned during reveal
yosofbadr 0a7731c
gh-15785: Remove redundant test introduction
yosofbadr bebb53b
gh-15785: Simplify gradient fix after review
yosofbadr 750bdc5
gh-15785: Remove unnecessary background-position priority
yosofbadr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just move it up here with the rest of the background related properties?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misunderstood your first comment as moving the rule inside
.zen-toolbar-background, rather than inside the existing pseudo-element block.If you meant this nesting, I tested it locally:
It brings back the right-sidebar gradient shift. The inner
&cannot represent the parent pseudo-elements, so the positioning does not apply. This is a CSS nesting limitation.We could keep the current structure, where the condition comes before the pseudo-elements:
Or use a custom property to put
background-positionalongside the other background properties:Both options pass all 16 rendering assertions on the local Firefox 157 runtime, including both background layers with the sidebar on the left and on the right. The deeper nesting above fails the two right-sidebar color checks. The left sidebar passes in all three versions.
Which approach would you prefer?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice, but I dont think we need
!important?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good callout on
!important. I verified that the current rule works without it and removed it.One clarification: the first snippet in my earlier reply was the failing example. Nesting the condition inside
&::before, &::afterdoes not work because the inner&cannot represent pseudo-elements. I reran that exact version with and without!important. Both leave the position at0% 0%and bring back the gradient shift. I agree it looks cleaner, but that nesting is not a working option.We have two working options:
!important:The second keeps the properties together, but adds a custom property and needs
!importantto override the existing, more specificbackgroundshorthand.Both pass the rendered-color checks for left/right sidebars and both background layers locally. Happy to use the second if you prefer that structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, in that case, it should be alright now