marp-team / marp-core

The core of Marp converter
MIT License
750 stars 127 forks source link

[v4] Always treat the slide container of built-in themes as block element #372

Open yhatt opened 2 months ago

yhatt commented 2 months ago

Recent browsers (Chrome >= 123, Firefox >= 125, Safari >= 17.4) become supported align-content: center for the block container.

section {
  display: block;
  align-content: center;
}

Currently Marp built-in themes are using the flexbox container as the slide section to make centering contents vertically.

section {
  display: flex;
  align-items: center;
}

However, some CSS features that are useful for the layout are not available in the flexbox:

They had actually brought users confusion like following:

In next major version, we have to consider to adopt align-content: center with display: block as the slide container for vertically centering.

Backward compatibillity

Between the block container and flexbox container, there is a small difference in the behavior of vertically centering when sticked out inner contents.

Changing the slide container style may affect to the layout of existing slides. Thus, this change must be a major change of Marp Core, and must provide a workaround to get back into the behavior of flex container through an inline style.