# "Surface Portability" _Path: en/frontend/micro-frontends/surface-portability_ > "Use container queries, surface variables, and host.surface to size view.page applications independently of the browser viewport." ## Table of Contents - Surface Portability ## Content # Surface Portability **Classification: rendering contract reference with focused examples.** The CSS, JavaScript, and package metadata blocks illustrate individual contract rules; they are not a complete application fixture. A micro frontend app receives a **surface**: the rectangular area the Web Host allocates to it. That area is usually **not** the browser window. The app may be one panel among several in a [multi-panel layout](../web-host/multi-panel-layout.md), and the same app may be rendered by either [render engine](../web-host/render-engines.md) at different sizes on the same screen. Sizing a layout to the window is therefore wrong in both engines. The surface contract gives you a portable alternative in CSS and in JavaScript. > **Status:** contract 1, shipped. Tailwind `surface-*` variants, host-mediated scrolling, and deep hit testing are **not yet shipped**; this page documents only what exists today. ### Container queries The host names the app's box `wippy-surface`, so it can be queried like any CSS container: ```css @container wippy-surface (min-width: 640px) { .sidebar { display: block; } } ``` Use this instead of `@media (min-width: 640px)` for anything that responds to the space the app occupies. Native container units resolve against the same box: ```css .hero { inline-size: 50cqw; } ``` ### Surface variables Four custom properties carry the geometry as plain pixel lengths: | Property | Meaning | |----------|---------| | `--wippy-surface-width` | full surface width | | `--wippy-surface-width-unit` | 1% of the surface width | | `--wippy-surface-height` | full surface height (container sizing only) | | `--wippy-surface-height-unit` | 1% of the surface height (container sizing only) | They are the portable replacement for `vw` / `vh`: ```css /* was: inline-size: 50vw */ .panel { inline-size: calc(var(--wippy-surface-width-unit) * 50); } ``` The values inherit, so any element in the app can read them. They report the query box's **content box**, which is the same box `100cqw` resolves against. Applications must **not** declare or assign these four names. A descendant declaration shadows the inherited value and silently unpins the app from the surface. They must also stay **unregistered**. Do not describe them with `@property` or `CSS.registerProperty()`. The host marks the block axis unavailable by assigning a guaranteed-invalid value, which computes to the empty string only while the property is unregistered. Give one an `initial-value` and it computes to that instead, so a content-sized app reports itself as container-sized and `supports('block-size')` starts returning `true` — with no error anywhere. Two caveats before comparing these values to `100cqw` pixel-for-pixel. The **first frame can be wider**: the boot value is seeded from the host-side `