eidos(box): las variables de cascada de Box dejan de heredarse

Bug de fondo, no de una página: `[data-box]` lee `var(--box-…)` para cada
propiedad del modelo de caja, y una custom property HEREDA por defecto. Un
`Section` —que es un Box con 64px de padding de bloque— se lo regalaba a
TODOS sus descendientes: Container, Stack, Group, Card… Cinco componentes de
layout anidados = cinco veces el padding. De ahí los cientos de píxeles de
aire muerto en la galería de blocks (que arrastraba el defecto desde F0) y en
la demo del site-header, y de ahí que el header dentro del escenario saliera
a 32px de ancho por 435 de alto: el hijo también heredaba anchos y displays
que no eran suyos.

Las 44 variables se registran con `@property { syntax:'*'; inherits:false }`
y sin valor inicial: así cada una queda «garantizada-inválida» salvo que la
ponga el PROPIO elemento, y las cadenas `var(--box-…, revert-layer)` resuelven
exactamente lo que su autor escribió — los props de ese Box, y si no, el
cascade normal.

Verificado: paddings anidados a 0 en la demo (antes 64 en cada nivel) · la
galería de blocks pasa de ~300px de aire a una cabecera compacta · el header
del escenario mide 950×49 (antes 32×435) · `vitest src/uix/eidos` 353/353 ·
barrido de regresión por /blocks y las demos de button, card, sidebar,
nav-tree y table: cero errores de consola, cero desbordes y alturas de página
sanas · `eidos-lint box` limpio · el CSS generado no cambia (la corrección
vive en el recipe).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
alpha-0.1-sec-dom
dev 3 months ago
parent 6b23aa7ef1
commit f98c844eda

@ -17,6 +17,198 @@
* shorthand resolution.
*/
/*
* Box's cascade variables are NOT inheritable.
*
* Every property below reads `var(--box-…)`, and a custom property inherits by
* default — so a `Section` (a Box with 64px of block padding) used to hand that
* padding to EVERY descendant Box: Container, Stack, Group, Card… Five nested
* layout components meant five times the padding, which is why pages built with
* the layout primitives grew hundreds of pixels of dead air (the blocks gallery
* and every block demo, 2026-07-23).
*
* Registering them with `inherits: false` and no initial value makes each one
* guaranteed-invalid unless the element ITSELF sets it, so the `var(…, fallback)`
* chains below resolve exactly as their author intended: this Box's own props,
* then `revert-layer`. Same reason `@property` exists.
*/
@property --box-align-self {
syntax: '*';
inherits: false;
}
@property --box-basis {
syntax: '*';
inherits: false;
}
@property --box-bottom {
syntax: '*';
inherits: false;
}
@property --box-display {
syntax: '*';
inherits: false;
}
@property --box-flex {
syntax: '*';
inherits: false;
}
@property --box-gap {
syntax: '*';
inherits: false;
}
@property --box-grid-area {
syntax: '*';
inherits: false;
}
@property --box-grid-column {
syntax: '*';
inherits: false;
}
@property --box-grid-row {
syntax: '*';
inherits: false;
}
@property --box-grow {
syntax: '*';
inherits: false;
}
@property --box-height {
syntax: '*';
inherits: false;
}
@property --box-inset {
syntax: '*';
inherits: false;
}
@property --box-inset-block {
syntax: '*';
inherits: false;
}
@property --box-inset-inline {
syntax: '*';
inherits: false;
}
@property --box-justify-self {
syntax: '*';
inherits: false;
}
@property --box-left {
syntax: '*';
inherits: false;
}
@property --box-margin {
syntax: '*';
inherits: false;
}
@property --box-margin-block {
syntax: '*';
inherits: false;
}
@property --box-margin-bottom {
syntax: '*';
inherits: false;
}
@property --box-margin-inline {
syntax: '*';
inherits: false;
}
@property --box-margin-left {
syntax: '*';
inherits: false;
}
@property --box-margin-right {
syntax: '*';
inherits: false;
}
@property --box-margin-top {
syntax: '*';
inherits: false;
}
@property --box-max-height {
syntax: '*';
inherits: false;
}
@property --box-max-width {
syntax: '*';
inherits: false;
}
@property --box-min-height {
syntax: '*';
inherits: false;
}
@property --box-min-width {
syntax: '*';
inherits: false;
}
@property --box-order {
syntax: '*';
inherits: false;
}
@property --box-overflow {
syntax: '*';
inherits: false;
}
@property --box-overflow-x {
syntax: '*';
inherits: false;
}
@property --box-overflow-y {
syntax: '*';
inherits: false;
}
@property --box-padding {
syntax: '*';
inherits: false;
}
@property --box-padding-block {
syntax: '*';
inherits: false;
}
@property --box-padding-bottom {
syntax: '*';
inherits: false;
}
@property --box-padding-inline {
syntax: '*';
inherits: false;
}
@property --box-padding-left {
syntax: '*';
inherits: false;
}
@property --box-padding-right {
syntax: '*';
inherits: false;
}
@property --box-padding-top {
syntax: '*';
inherits: false;
}
@property --box-place-self {
syntax: '*';
inherits: false;
}
@property --box-position {
syntax: '*';
inherits: false;
}
@property --box-right {
syntax: '*';
inherits: false;
}
@property --box-shrink {
syntax: '*';
inherits: false;
}
@property --box-top {
syntax: '*';
inherits: false;
}
@property --box-width {
syntax: '*';
inherits: false;
}
[data-box] {
box-sizing: border-box;
min-width: 0;

Loading…
Cancel
Save

Powered by TurnKey Linux.