Blending Tinting and Page Blurs
A sheet or a dialog dims and blurs the page behind it with a translucent layer: a scrim. Safari ignores the scrim, so the status bar and the toolbar keep the page color above and below the dimmed page.
A solid strip at the edge, in the color the scrim shows over the page, makes them match the scrim.
Sheet
The sheet covers the bottom edge, and Safari tints the toolbar with the color of the sheet. Only the top edge needs a strip.
Dialog
The dialog touches no edge, so both edges need a strip.
Rules
- Mount the strips with the scrim and remove them with it. Safari then returns to the page color by itself.
- Put the strips beside the scrim, not inside it. The scrim has a
backdrop-filter, and Safari does not tint for an element inside one. - The strip color is the scrim color mixed over the page color at the edge. Use the color of a fixed header instead of the page color if one is at the edge.
- On macOS and iPad, opening the sheet or the dialog is an interaction, after which Safari keeps its top color until the page reloads. The top strip works on iPhone only.
Technique: gist by caelinsutch. Code for this page: scrim.html.