Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS container query support (@container) #355

Closed
yhatt opened this issue Feb 18, 2023 · 2 comments · Fixed by #377
Closed

CSS container query support (@container) #355

yhatt opened this issue Feb 18, 2023 · 2 comments · Fixed by #377
Assignees
Labels
enhancement New feature or request

Comments

@yhatt
Copy link
Member

yhatt commented Feb 18, 2023

CSS container query is now available in all modern browsers. We can consider to treat the slide container as the CSS container.

If supported, the Markdown author can tweak style with the container query that is matching the size defined by the theme.

It might be not helpful because Marpit is not designed that the theme has multiple sizes, but it will be helpful in some variations of Marpit (e.g. Marp Core: the theme may have defined multiple sizes).

@yhatt yhatt converted this from a draft issue Feb 18, 2023
@yhatt yhatt self-assigned this Feb 18, 2023
@yhatt yhatt added the enhancement New feature or request label Feb 20, 2023
@EdwardPrentice
Copy link

I think this would be helpful for a media query around font size to basically allow the author to say "font-size to fit contents into slide please" and avoid overflowing. At least that's what I was trying yesterday, I might have been barking up the wrong tree though.

@yhatt
Copy link
Member Author

yhatt commented Oct 1, 2023

@EdwardPrentice You already can test CSS container query by defining container-type: size within the section selector.

section {
  container-type: size;
}

/* Container query */
@container (width > 1000px) {
  h1 {
    color: red;
  }
}

h1 {
  font-size: 5cqw; /* Container-based unit */
}

I'm wondering if should add CSS container query support at the framework level, or should leave container-type declaration up to the theme/document author. We want more opinions from community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants