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

Expose selected size to the parent of each slide #135

Closed
yhatt opened this issue Dec 5, 2019 · 0 comments · Fixed by #144
Closed

Expose selected size to the parent of each slide #135

yhatt opened this issue Dec 5, 2019 · 0 comments · Fixed by #144
Labels
enhancement New feature or request

Comments

@yhatt
Copy link
Member

yhatt commented Dec 5, 2019

This idea came from #134.

By exposing selected size as data attribute of <section> slide container, theme author can change style by size.

---
theme: xxx
size: A4
---

# Hello!
<section data-size="A4">
  <h1>Hello!</h1>
</section>
/*!
 * @theme xxx
 * @size 4:3 960px 720px
 * @size A4 210mm 297mm
 */

section {
  /* Default style (16:9) */
}

section[data-size="4:3"] {
  /* Style for 4:3 slide */
}

section[data-size="A4"] {
  /* Style for A4 slide */
}

It might be better to work at Marpit framework, to expose the value of global directives as like as local directives.

@yhatt yhatt added the enhancement New feature or request label Dec 5, 2019
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
None yet
Development

Successfully merging a pull request may close this issue.

1 participant