Update display style of built-in themes container #382
+56
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #372.
The default slide container is now the block element.
Modern browsers can be centering child elements by using
align-content: center
. This change will reduce confusion about properties that are incompatible with Flexbox, such asfloat: right
,columns: 2
, and so on.Breaking change
Safe centering
In this update, we have also adopted "safe centering", that may break the layout of slides for existing presentations.
https://developer.mozilla.org/en-US/docs/Web/CSS/align-content#safe
Behavior
Let’s consider a scenario that the slide content will overflow beyond the padding of the slide container.
Until Marp Core v3, the content is always vertically centered. If the slide has a lot of content, it will overflow from both the top and bottom of the slide container.
In Marp Core v4 and later, the content no longer overflows beyond the safe padding at the top. Contents will consistently overflow from the bottom.
This change will be a breaking change for users who have relied on the previous centering, but we believe it is worth making this adjustment to support the creation of higher-quality presentations.
Use unsafe centering
If you want to use unsafe centering, you can tweak with the following CSS:
default
anduncover
themegaia
theme (forlead
class)Unsafe centering always will center the slide contents even if overflowed, like before. The slide container is still the block element.
Revert to
flex
container (v3's default)Instead of unsafe centering, you can also revert the slide container to Flexbox as same as Marp Core v3. Just set
display: flex
to the slide container:default
anduncover
themegaia
theme (forlead
class)