8000 Column styling, and rounded corners per viewport in the kit by Klehm · Pull Request #104 · Klehm/content-blocks-project · GitHub
[go: up one dir, main page]

Skip to content

Column styling, and rounded corners per viewport in the kit - #104

Merged
Klehm merged 2 commits into
masterfrom
feat/column-styling
Dec 4, 2026
Merged

Klehm merged 2 commits into
masterfrom
feat/column-styling

Conversation

@Klehm
@Klehm Klehm commented Dec 4, 2026
Copy link
Copy Markdown
Owner

Summary

Core: style each column on its own. The section sidebar gets a Columns style tab with one panel per column:

  • padding per viewport;
  • background colour, and a background image with its veil;
  • rounded corners, per corner and per viewport;
  • vertical alignment.

These are stored under styling in the column's settings, so they wait for Publish and they undo, copy, paste, export and import like the column label.

  • A styled column wraps its blocks in .cb-col__inner, because padding on the column itself would make it wider than its neighbours. An unstyled column's markup does not change at all.
  • Host stylesheets that reach blocks with .cb-col > .cb-block should use .cb-col .cb-block, otherwise they miss the blocks of a styled column. The styling guide says so.
  • The background image follows the same rules as the section's; BackgroundImage is now shared by both.
  • Covered by:
    • the asset GC and export/import;
    • the headless tree (columns[].styling);
    • the AI content schema ($defs.columnStyling). It is derived from the tab's own form, and it leaves out fields added by host StylingType extensions, which a column does not keep.
  • BoxSpacingType and ResponsiveBoxSpacingType take a corners option.
  • Also fixed:
    • when several saves are merged into one undo step, their changes now merge field by field;
    • cb-condition reads the controls of its own scope before those of a nested scope.

Kit: rounded corners per viewport on the image and the gallery.

  • borderRadius becomes {desktop, tablet, mobile}.
  • The fields are labelled by corner (↖ ↗ ↘ ↙) when the installed core offers the corners option.
  • A radius stored in the old shape is read as the desktop value, with no migration:
    • in the form (a model transformer), so opening or pasting a block keeps its radius;
    • in the views;
    • in the headless JSON.
  • An image with a desktop-only radius renders exactly as before.
  • Headless clients: the JSON now always uses the per-viewport shape, so borderRadius.top becomes borderRadius.desktop.top.

Rationale: docs/internals/rendering.md#column-styling, docs/internals/kit.md#a-radius-per-viewport.

Test plan

  • PHPUnit: core 1581, kit 436, i18n, media, seo
  • Vitest: core 607, kit 70
  • Playwright main suite (273, including the new column-styling.spec.js and kit-image-radius.spec.js) and Encore suite (11)
  • PHPStan level 8, php-cs-fixer, internal doc links
  • Both published-render immutability nets cover styling a column

Klehm added 2 commits December 4, 2026 11:17
The section sidebar gets a Columns style tab, one panel per column:
padding per viewport, background colour, background image with its veil,
rounded corners per corner and per viewport, vertical alignment. Stored
under `styling` in the column's settings, so it waits for Publish, undoes,
copies, exports and imports like the label.

A styled column wraps its blocks in `.cb-col__inner`, since padding on the
column would widen it; an unstyled column keeps its markup byte for byte.
The background image goes through the section's rules (`BackgroundImage`,
now shared). Covered by the asset GC, export/import, the headless tree
(`columns[].styling`) and the AI content schema (`$defs.columnStyling`,
derived from the tab's form, host StylingType extensions left out since a
column would drop them).

Also: coalesced journal entries merge their ops field by field, and
cb-condition reads its own scope's controls before a nested scope's.
`BoxSpacingType` / `ResponsiveBoxSpacingType` take a `corners` option.
`borderRadius` becomes `{desktop, tablet, mobile}`, each set labelled by
corner when the core offers the `corners` option. A corner left empty keeps
the wider viewport's value, at the kit's breakpoints (768 / 540).

A radius stored before, one set of corners, reads as the desktop one in the
form (model transformer), the views and the headless JSON, with no
migration. A desktop-only image radius renders as it did.
@Klehm
Klehm merged commit 6d37981 into master Dec 4, 2026
53 checks passed
@Klehm
Klehm deleted the feat/column-styling branch December 4, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0