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

Implement background image sizing with keyword and scale #10

Merged
merged 5 commits into from
Apr 30, 2018

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Apr 29, 2018

Support assigning backgroundSize spot directive in Marpit background syntax. It can use the keyword value of background-size style, and fit keyword that is a compatible syntax with Deckset. Of course it can specify a percentage as scale.

![bg contain](https://example.com/bg.jpg) <!-- Fit to slide size -->
![bg fit](https://example.com/bg.jpg)     <!-- Compatible syntax with Deckset -->
![bg auto](https://example.com/bg.jpg)    <!-- Keep original image size -->
![bg 125%](https://example.com/bg.jpg)    <!-- Specified scale -->

NOTE: The pre-release version of Marp is supported inline image scaling. It uses zoom style but it has not supported in Firefox. Marpit's static HTML output requires cross-browser support.

In addition we do not want to change DOM tree for this. Marpit's theme CSS would become to not clear markup. (PostCSS plugin might resolve it)

ToDo

  • Add tests

@yhatt yhatt merged commit 6e13d67 into master Apr 30, 2018
@yhatt yhatt deleted the background-image-sizing branch April 30, 2018 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant