ReqoreTier: no way to tune the spacing between its sections without overriding internal DOM

Abierto
#676 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
56/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
css, react, typescript
Área
design, frontend

Línea de trabajo

Start by locating the ReqoreTier component and its ReqoreControlGroup layout, then check the related tests and how section spacing is currently rendered. The issue offers several possible solutions, so confirm the intended API with maintainers before choosing an approach. Done means consumers can control spacing between Tier sections without relying on positional DOM selectors.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

The gap ReqoreTier gives you, and the one you want

Inside a Tier, the price block, the description, the action button and the feature
list are children of one vertical ReqoreControlGroup with a single gapSize='big'.
There is no prop for the spacing between them, so a consumer who wants the price
detail ("No credit card required") to sit closer to its button than to the next
section has exactly one option: reach into the rendered DOM.

That is what the Qorus marketing site does on /pricing:

/* src/pages/PricingPage.tsx */
.reqore-spacer + .reqore-control-group > .reqore-control-group:nth-child(2):not(:has(.reqore-icon)) {
  .reqore-paragraph:last-child { padding-bottom: 16px; }
  & + * { margin-top: -16px; }
}

Two things are wrong with it, and both are ours to fix rather than theirs:

  1. It is structural, so it breaks silently. Any change to the Tier's internal
    markup — one more ReqoreVerticalSpacer, a wrapper around the price — retargets
    or detaches the rule, with no type error and no test failure.
  2. It cannot be aimed. .reqore-spacer + .reqore-control-group > .reqore-control-group:nth-child(2)
    matches the feature list too, because that list also follows a spacer. The
    -16px therefore landed on a feature row and pulled it up over the row above
    whenever the text wrapped to two lines. The :not(:has(.reqore-icon)) above is
    the workaround (feature rows always start with a check icon) — a selector nobody
    should have to reason about to set a margin.

What would solve it

Anything that names the sections instead of counting them. In rough order of
preference:

  • gapSize per section, e.g. priceGapSize / contentGapSize / featureGapSize
    (or one gaps={{ price: 'small', features: 'normal' }}).
  • Stable class hooks on the Tier's parts — .reqore-tier-price,
    .reqore-tier-action, .reqore-tier-features — so a consumer's CSS targets a
    documented contract rather than sibling position. Cheap, and it fixes the
    "matched the wrong group" half on its own.
  • A priceDetail slot that owns its own spacing, since "small print under the
    price, tight to the button below it" is the case every pricing page has.

Related: #675 (the Tier drops
currency when price is a string) came out of the same page.

Lenguaje dominante
TypeScript
Estrellas
4
Forks
0
Merge medio
16 h 28 min
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de qoretechnologies/reqore

Todos los issues de qoretechnologies/reqore

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.