Skip to content

v0.4.5

Choose a tag to compare

@github-actions github-actions released this 08 Jun 09:22

What's Changed

Added

  • iframe.page_wrapper_class config. Set it in styleguide.yaml and every page render is wrapped in <div class="…"> — the project's structural shell (the page-wrapper sticky-footer flex column / min-h-dvh that the production layout puts around header + main + footer). Applied to kind: page only (never component / doc previews, so the full-height shell can't leak into a small preview), built through create_attribute (same class-escaping contract as the <body> line). Default '' renders no wrapper, keeping the package framework-agnostic — Tailwind projects opt in, Bootstrap / custom consumers leave it blank. Completes the production-parity pair with body_class: body_class reproduces the page's <body>, page_wrapper_class reproduces the wrapper <div> — so a page preview matches production without each consumer hand-wrapping every page/<name>/styleguide.twig. Flows through the existing iframe.* passthrough (Styleguide → Renderer → render-cell.twig), no PHP changes.

  • Per-entry body_class metadata. A component / page / doc can declare body_class: "…" in its front-comment metadata; the render iframe applies it to <body>, merged after the global iframe.body_class via create_attribute({ class: [iframe.body_class, <entry>.body_class] }) (empty values dropped — no stray class=""). Lets a page mirror what its production layout puts on <body> (e.g. a dark brand background from an ACF body_background_color) instead of wrapping the page body in a styleguide-only <div class="bg-… body-…">. Parsed into the component record (so it also surfaces in /api/* + the CLI) and threaded through Styleguide → Renderer → render-cell.twig.

Fixed

  • Static analysis & PHP 8.4 deprecations. The typography translation helpers (_xt / __t / _nt / _nxt) now resolve their underlying Twig function callable through a guarded helper, clearing 9 PHPStan level-8 errors (getFunction() / getCallable() are nullable in Twig's signature) with no behaviour change — the fallback mirrors the identity stubs registered just above. PHPUnit now defines <source> and sets ignoreIndirectDeprecations, muting the implicitly-nullable-parameter deprecations emitted by the upstream mundschenk-at/php-typography (its latest release v6.7.0 is the ceiling of our ^6.0 constraint, so the deprecations are unfixable here); our own src/ deprecations still surface.

Pull Requests

  • #42 — Per-entry body_class metadata applied to render
  • #43 — Clear PHPStan level-8 errors + mute upstream PHP 8.4 deprecations
  • #45 — feat: iframe.page_wrapper_class — page-only structural wrapper

Full Changelog: v0.4.4...v0.4.5