-
Notifications
You must be signed in to change notification settings - Fork 0
Prevent bottom of page from being swipable #73
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
Open
Coteh
wants to merge
1
commit into
main
Choose a base branch
from
claude/disable-bottom-swipe-RcaIX
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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.
🧩 Analysis chain
🌐 Web query:
What is current support (including Android WebView) for CSSenv(safe-area-inset-bottom)and CSSmax()in property values, and are there known parsing/fallback caveats when combined asmax(env(...), 50px)?💡 Result:
Support (as of March 2026)
env(safe-area-inset-bottom)Notes:
max()in CSS property values (CSS math function)min()/max()/clamp()land in Chromium 79). [4]Caveats when using
max(env(...), 50px)If
max()isn’t supported, the whole declaration is invalid (dropped).This is the big practical issue on older Safari / older Chromium/WebView. Use a fallback declaration before it, or gate with
@supports. [4][5]Example pattern:
If
env()is supported but the variable is unknown/invalid at computed-value time, behavior can “snap” to initial/inherited (not “ignore the declaration”).MDN notes
env()is accepted at parse time, but validity is checked after substitution; if invalid and no valid fallback is provided, you can end up with the property’s initial/inherited value. [5]Mitigation: always include a valid fallback inside
env(…, <fallback>).Android edge-to-edge: using
env(safe-area-inset-bottom)in padding on bottom-fixed UI can cause performance/layout issues.Chrome’s Android edge-to-edge guidance explicitly warns that patterns like
padding-bottom: env(safe-area-inset-bottom, …)on bottom-anchored elements can cause “layout thrashing” (and can affect how the browser UI animates). They recommend alternative patterns usingsafe-area-max-inset-bottom+calc()for performant animation with the “chin” behavior. [6]In short: today,
max(env(safe-area-inset-bottom, 0px), 50px)is fine on modern engines (Chromium/WebView ≥79, Safari ≥13.1, Firefox ≥75), but you still want a plain fallback declaration for older browsers, and on Android edge-to-edge you should be careful about using the dynamic inset in padding on bottom-fixed UI. [4][6]Sources:
[1] Can I use: CSS env() function https://caniuse.com/css-env-function
[2] BCD feature:
css.types.env.safe-area-inset-bottom(includes WebView Android 69) https://bcd-training.deno.dev/feature?id=css.types.env.safe-area-inset-bottom[3] Android Developers: “Understand window insets in WebView” https://developer.android.com/develop/ui/views/layout/webapps/understand-window-insets
[4] Can I use: CSS math functions min/max/clamp https://caniuse.com/css-math-functions%2Ccss-variables
[5] MDN:
env()parsing/computed-value behavior https://developer.mozilla.org/en-US/docs/Web/CSS/env[6] Chrome Developers: Android edge-to-edge + safe-area inset guidance https://developer.chrome.com/docs/css-ui/edge-to-edge
🏁 Script executed:
cat -n src/styles/components/swipe.css | head -15Repository: Coteh/2048-clone
Length of output: 440
Add a CSS fallback for
max()function support and explicitenv()fallback parameter.Line 6 uses
max(env(safe-area-inset-bottom), 50px), butmax()support only landed in WebView 79+, Chrome 79+, Firefox 75+, and Safari 13.1+. On older browsers, the entire declaration is dropped, leaving the swipe area without explicit bottom positioning. Add a plain fallback declaration before the advanced rule, and ensureenv()includes an explicit fallback parameter.Proposed CSS fix
.swipe-area { position: absolute; top: 25vh; opacity: 0; width: 100%; + bottom: 50px; - bottom: max(env(safe-area-inset-bottom), 50px); + bottom: max(env(safe-area-inset-bottom, 0px), 50px); background-color: lightgray;📝 Committable suggestion
🤖 Prompt for AI Agents