Definition
display-mode media query
display-mode is a CSS media feature, usable both in stylesheets (@media (display-mode: standalone) { ... }) and in JavaScript via window.matchMedia("(display-mode: standalone)").matches, that reports which of browser, minimal-ui, standalone or fullscreen is currently applied to the page — regardless of what the manifest requested, since the OS can downgrade the requested mode.
A common CSS use is adding safe-area padding or hiding a redundant in-page "back" button only when running standalone: @media (display-mode: standalone) { .app-header { padding-top: env(safe-area-inset-top); } }.
Because display-mode reflects the mode actually in effect rather than the value requested in the manifest, it is the correct tool for any conditional logic about the *current* session, whereas the manifest's display field is only ever a request evaluated at install/launch time.
The media feature can be watched for changes with matchMedia(...).addEventListener("change", handler), useful on desktop where a user can, in some browsers, toggle window controls overlay related modes without a full reload.
It is specified as part of the Media Queries used by the Web App Manifest spec and documented at https://developer.mozilla.org/en-US/docs/Web/CSS/@media/display-mode.