cssContainerQuery
constructor option
#377
Merged
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.
Added
cssContainerQuery
constructor option to support CSS container queries,@container
at-rule andcqw
cqh
cqi
cqb
cqmin
cqmax
units for child elements of the slide elementsection
.By enabling this option, Marpit will become able to use features that related to CSS container queries, within both of the theme and the tweaked styles by Markdown.
If passed string or array of strings to
cssContainerQuery
, Marpit will set the container name to identify the slide element in@container
at-rule.If the
container-size
andcontainer-name
CSS declaration were already declared tosection
element through the theme CSS or tweaked styles, Marpit prefers them than the injected style by the constructor option. The injected style has low CSS specificity by using:where
selector.For keeping backward compatibillity,
cssContainerQuery
constructor option isfalse
by default in Marpit v2. In downstream libraries and tools of Marp ecosystem, we may enable this option by default.Resolves #355.