The radius subtraction rule keeps nested glass looking physically correct. The inner radius should equal the outer radius minus the padding between them:
function GlassPanel({ children }: { children: React.ReactNode }) {
const outerRadius = 24;
const padding = 12;
const innerRadius = outerRadius - padding; // 12px
return (
<div style={{
borderRadius: outerRadius,
padding: padding,
background: "rgba(255, 255, 255, 0.4)",
border: "1px solid rgba(255, 255, 255, 0.15)",
}}>
<div style={{
borderRadius: innerRadius,
background: "rgba(255, 255, 255, 0.25)",
}}>
{children}
</div>
</div>
);
}If the inner panel also has padding with nested content, continue the subtraction chain. Never go below `4px` for inner radius — it starts looking off at that point.