fix(appearance): draw the external drop shadow around rounded window
Phase 2 produced clean rounded corners but no visible shadow because .app filled 100vw/100vh, leaving no pixels for box-shadow to paint into — and the clip-path added for anti-alias was clipping the shadow as well. Reserve a 12px padding on body while match-chrome-transparent is active and shrink .app by the matching 24px in width/height, so the outer drop shadow has somewhere to render. Drop clip-path (it was consuming the shadow); keep transform: translateZ(0) for GPU AA on the corners. Two-layer shadow: a broad soft ambient (18/40 rgba(0 0 0 / 0.65)) plus a tight 4/12 crisp shadow for edge definition without painting a hard 1px stroke that jaggies at the rounded joint. cc
This commit is contained in:
1 parent
823e1c313e
commit
74d4d98e42
1 file changed
+17
-9
+17
-9
@@ -6228,23 +6228,31 @@
|
||||
:global(html.match-chrome-transparent),
|
||||
:global(html.match-chrome-transparent body) {
|
||||
background: transparent !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
/* Give the body a small padding only when we want the external shadow.
|
||||
This leaves pixels _outside_ the .app container for the box-shadow
|
||||
to paint into — otherwise .app fills 100vw/100vh and the shadow has
|
||||
nowhere to go. The padding is compensated by shrinking .app below. */
|
||||
:global(html.match-chrome-transparent body) {
|
||||
padding: 12px !important;
|
||||
box-sizing: border-box !important;
|
||||
}
|
||||
.app.match-chrome.floating {
|
||||
height: calc(100vh - 24px);
|
||||
width: calc(100vw - 24px);
|
||||
border-radius: var(--chrome-radius, 10px);
|
||||
/* clip-path gives cleaner anti-aliasing on rounded corners in
|
||||
WebKitGTK than border-radius + overflow:hidden alone. Keep
|
||||
border-radius too so the box-shadow follows the rounded shape. */
|
||||
clip-path: inset(0 round var(--chrome-radius, 10px));
|
||||
/* GPU-accelerate the clipped container so WebKitGTK picks a smoother
|
||||
anti-alias path on the rounded edge. */
|
||||
transform: translateZ(0);
|
||||
backface-visibility: hidden;
|
||||
/* Drop shadow only — no hard 1px outline, which amplifies jaggies on
|
||||
rounded corners in WebKitGTK. The shadow alone is enough to lift
|
||||
the window off the desktop. */
|
||||
/* External drop shadow — takes the 12px margin we reserved on body
|
||||
to actually be visible. Two-layer: a broad soft shadow below + a
|
||||
tight crisp shadow that gives edge definition without painting a
|
||||
hard 1px stroke (which jaggies at the rounded corners). */
|
||||
box-shadow:
|
||||
0 16px 32px rgba(0, 0, 0, 0.55),
|
||||
0 2px 8px rgba(0, 0, 0, 0.35);
|
||||
0 18px 40px rgba(0, 0, 0, 0.65),
|
||||
0 4px 12px rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
.app.match-chrome:not(.floating) {
|
||||
border-radius: 0;
|
||||
|
||||
Reference in new issue
Block a user