@@ -3,11 +3,11 @@ import * as stylex from '@stylexjs/stylex';
33import { colorVars , durationVars , easingVars , radiusVars , space } from '../../tokens.stylex' ;
44
55// How far the contents of a surface beneath a stacked dialog are veiled toward its own background.
6- // Declared up here rather than beside `STACK_SCALE` further down because `sizes ` reads it, and
6+ // Declared up here rather than beside `STACK_SCALE` further down because `variants ` reads it, and
77// StyleX requires a referenced constant to be declared before the `create()` call that reads it.
88const STACK_VEIL_OPACITY = 0.4 ;
99
10- // The card's width cap, read by `sizes .card` and restated by `compactPlacements.sheet` — which
10+ // The card's width cap, read by `variants .card` and restated by `compactPlacements.sheet` — which
1111// has to declare `max-width` itself to lift it in the compact band, and would otherwise fork the
1212// value.
1313const CARD_MAX_WIDTH = '25rem' ;
@@ -31,7 +31,7 @@ const BASE_SCRIM = 'color-mix(in oklab, oklch(0 0 0) 40%, transparent)';
3131 * winner to source order, which `@stylexjs/sort-keys` reorders on autofix — and its string sort
3232 * would put a future `100rem` band BEFORE `48rem`, silently inverting the ladder.
3333 *
34- * `prefers-reduced-motion` and `forced-colors` stay `@media`: they are preferences, not sizes .
34+ * `prefers-reduced-motion` and `forced-colors` stay `@media`: they are preferences, not widths .
3535 */
3636// `48rem` is also the Profile's compact band (`compact` in `profile.styles.ts`); the two must agree.
3737const PHONE = '@container cl-dialog (width < 48rem)' ;
@@ -81,16 +81,16 @@ export const styles = stylex.create({
8181 /**
8282 * The headless viewport element, inside the `FloatingOverlay` that owns the fixed positioning
8383 * and the scroll lock. Two jobs: it is the query container every band reads — see `PHONE` and
84- * friends above — and it is the box the sizes measure against. Whether that box is a fixed
85- * height or grows with its content is the whole outside-scroll question, and it differs per
86- * size — see `viewportSizes ` below.
84+ * friends above — and it is the box each variant is measured against. Whether that box is a
85+ * fixed height or grows with its content is the whole outside-scroll question, and it differs
86+ * per variant — see `viewportVariants ` below.
8787 *
8888 * It carries NO band of its own, and cannot: an element is never its own query container, so a
8989 * `@container cl-dialog` rule on this element would resolve against some OUTER dialog's viewport
9090 * — or nothing. Everything width-dependent lives on `track`, the padded grid inside it.
9191 *
9292 * `inline-size` rather than `size`: block-size containment would stop the box growing with its
93- * content, which is exactly what the outside-scroll sizes need it to do, and no band queries
93+ * content, which is exactly what the outside-scroll variants need it to do, and no band queries
9494 * height. A grid so the track fills it: an `auto` row stretches to the container's used height,
9595 * `min-height` included, which is what hands the track a definite box to centre within.
9696 */
@@ -143,7 +143,7 @@ export const styles = stylex.create({
143143 // so it is inert until `acquireKeyboardInset` has something to report.
144144 paddingBlockEnd : 'calc(var(--_cl-dialog-inset) + var(--_cl-keyboard-inset, 0px))' ,
145145 // A grid item's automatic minimum would otherwise hold this to its content and defeat the
146- // definite row `viewportSizes .profile` pins.
146+ // definite row `viewportVariants .profile` pins.
147147 minHeight : 0 ,
148148 width : '100%' ,
149149 } ,
@@ -172,7 +172,7 @@ export const styles = stylex.create({
172172 * paint over it and stay undimmed. Never interactive: the whole subtree is inert while a
173173 * stacked dialog holds focus, and `pointer-events: none` keeps it that way regardless.
174174 *
175- * The variable itself is set per size — only `card` sets it, in `sizes ` below — so this
175+ * The variable itself is set per variant — only `card` sets it, in `variants ` below — so this
176176 * reads `0` on a `profile`, which gets a scrim of its own between it and what it hosts and
177177 * would otherwise dim as well as darken.
178178 */
@@ -189,7 +189,7 @@ export const styles = stylex.create({
189189 borderColor : { default : null , '@media (forced-colors: active)' : 'CanvasText' } ,
190190 // No paint of its own, but the radius is what the HCM border above and the veil below trace,
191191 // and both are standing in for a surface. Matches `Card`'s own radius, which is what they
192- // trace in practice; `sizes .profile` nulls it, since a profile owns its corners at every band.
192+ // trace in practice; `variants .profile` nulls it, since a profile owns its corners at every band.
193193 borderRadius : radiusVars [ '--cl-radius-xl' ] ,
194194 borderStyle : { default : null , '@media (forced-colors: active)' : 'solid' } ,
195195 borderWidth : { default : null , '@media (forced-colors: active)' : '1px' } ,
@@ -232,7 +232,7 @@ export const styles = stylex.create({
232232 * participates in the column's `gap` and a consumer can render it anywhere in the children
233233 * without the layout moving.
234234 *
235- * It stays put on a `profile` because the popup itself never scrolls — see `sizes .profile`. An
235+ * It stays put on a `profile` because the popup itself never scrolls — see `variants .profile`. An
236236 * absolutely positioned child of a scroll container scrolls away with the content, so the
237237 * scroll region has to live in the profile's children, not on the popup.
238238 *
@@ -306,19 +306,19 @@ export const closeInsets = stylex.create({
306306 * instead: the padding travels with the content, and short dialogs still fill the overlay so the
307307 * track has something to centre against.
308308 */
309- export const viewportSizes = stylex . create ( {
309+ export const viewportVariants = stylex . create ( {
310310 card : { minHeight : '100%' } ,
311311 profile : {
312312 // A definite container height is NOT enough on its own: an `auto` grid row still sizes to its
313313 // content and happily exceeds the container, which is how a profile of rows measured 2208px
314314 // inside a 1251px overlay. `minmax(0, 1fr)` pins the single row to the content box, so the row
315315 // is what an item stretches to and what its overflow is measured against.
316316 //
317- // Deliberately NOT applied to the scrolling sizes : it would clamp the row there too, which is
317+ // Deliberately NOT applied to the scrolling variants : it would clamp the row there too, which is
318318 // exactly what has to stop happening for the popup to grow past the fold.
319319 gridTemplateRows : 'minmax(0, 1fr)' ,
320320 // A DEFINITE height, taken from the overlay (`position: fixed; inset: 0`), which makes the
321- // single grid row definite too. That is what lets `sizes .profile` fill the content box with
321+ // single grid row definite too. That is what lets `variants .profile` fill the content box with
322322 // `align-self: stretch` alone — no `dvh` arithmetic, so nothing can disagree with the box a
323323 // bottom-anchored sheet aligns to. They genuinely do diverge: on an emulated iPhone the
324324 // overlay measures 1251px while `100dvh` reports 844.
@@ -327,7 +327,7 @@ export const viewportSizes = stylex.create({
327327} ) ;
328328
329329/** The per-size half of `styles.track` — the rules that need the band, and so must sit inside the container. */
330- export const trackSizes = stylex . create ( {
330+ export const trackVariants = stylex . create ( {
331331 card : { } ,
332332 profile : {
333333 // Under the phone band a profile takes the whole screen: it is the page there, not a surface
@@ -346,7 +346,7 @@ export const trackSizes = stylex.create({
346346 } ,
347347} ) ;
348348
349- export const sizes = stylex . create ( {
349+ export const variants = stylex . create ( {
350350 // The surface is a `Card` — so it comes from `Card`'s own `elevations.overlay`, and the popup
351351 // contributes geometry and motion. Compose it by rendering the card INSIDE the popup:
352352 //
@@ -437,7 +437,7 @@ export const compactPlacements = stylex.create({
437437 // shared: bottom-aligning there would drag a centred dialog down with it.
438438 //
439439 // The popup's own cap is lifted at the same time so it spans the width the inset leaves, and
440- // the surface inside decides how much of that it takes. `default` restates `sizes .card`'s cap
440+ // the surface inside decides how much of that it takes. `default` restates `variants .card`'s cap
441441 // rather than leaving it to the cascade: this cell is spread after that one in the same
442442 // `stylex.props` call, so StyleX dedupes `max-width` to whatever is written here. Both read
443443 // the same constant, so there is one value to retune.
@@ -446,7 +446,7 @@ export const compactPlacements = stylex.create({
446446 } ,
447447} ) ;
448448
449- /** The per-placement half of `styles.track` — the rules that need the band. See `trackSizes `. */
449+ /** The per-placement half of `styles.track` — the rules that need the band. See `trackVariants `. */
450450export const trackCompactPlacements = stylex . create ( {
451451 center : { } ,
452452 sheet : {
0 commit comments