Skip to content

Content element margins#2361

Merged
tf merged 16 commits intocodevise:masterfrom
tf:margins
Mar 4, 2026
Merged

Content element margins#2361
tf merged 16 commits intocodevise:masterfrom
tf:margins

Conversation

@tf
Copy link
Member

@tf tf commented Mar 3, 2026

REDMINE-21191

tf added 3 commits February 27, 2026 15:58
Allows themes to customize margin values used for spacing between
content elements. Includes translations for the scale labels.

REDMINE-21191
@tf tf added this to the v17.2 milestone Mar 3, 2026
@tf tf changed the title Margins Content element margins Mar 3, 2026
@tf tf force-pushed the margins branch 4 times, most recently from b7af70d to 8ec57d8 Compare March 3, 2026 19:19
tf added 13 commits March 4, 2026 08:45
Enable CSS-based margin collapsing by exposing margin values as custom
properties (--margin-top, --prev-margin-bottom) instead of inline
styles. The CSS now uses max() to pick the larger of the current
element's top margin and the previous element's bottom margin.

Only inline elements participate in margin tracking - side/sticky
elements are skipped when determining the previous margin bottom.

REDMINE-21191
Render a label element so the inputView mixin can display
a translated label. Existing usages pass hideLabel to keep
their current appearance.

The style list input unconditionally pulled itself up via
negative margin-top. Make this conditional on the hideLabel
option so it only compensates for a hidden label when one is
actually hidden.

REDMINE-21191
Allow style types to use values/texts arrays for sliders
with predefined steps instead of continuous min/max ranges.
Discrete sliders save on slide for immediate feedback.

REDMINE-21191
Replace individual select inputs with a unified style list
input that editors can use to add margin styles. This aligns
the margin configuration UI with the pattern used for image
modifiers.

REDMINE-21191
Allow style types to specify a propertyName so their value
is stored directly on the model (e.g. marginTop: 'md')
instead of inside the serialized styles array. This keeps
margin data compatible with the previous select inputs.

REDMINE-21191
Show diagonal stripe overlays with scale text tooltips on
top/bottom margins when a content element is selected in the
editor. Only rendered when the content_element_margins feature
is enabled and a margin value is explicitly configured.

REDMINE-21191
When removing a style whose type defines a resetValue, set the
model property to that value instead of unsetting it. This
prevents regressions for content elements like heading which
rely on the presence of marginTop in configuration (e.g. for
forcePaddingTop).

getTypesForContentElement now accepts the content element and
derives resetValue from its defaultConfig, so the heading's
defaultConfig marginTop of 'none' is preserved when the margin
style is removed from the list.

REDMINE-21191
Prevents the built-in subtitle bottom margin from overriding
a custom bottom margin set via the style list.

REDMINE-21191
Elements with width sm or smaller should share a layout
group with md-width elements so they are rendered inside
the same content box rather than being separated into
individual boxes.

REDMINE-21191
When the last content element in a card box has a custom bottom
margin, the card's built-in bottom padding is suppressed to
avoid double spacing. The card's margin and border radius at
the end are preserved.

REDMINE-21191
@tf tf merged commit f371962 into codevise:master Mar 4, 2026
18 checks passed
@tf tf deleted the margins branch March 4, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant