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

Support image resizing with width and height keyword #62

Merged
merged 9 commits into from
Sep 1, 2018
Merged

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Sep 1, 2018

This PR will support image resizing with width and height keyword as like as the other image keywords.

Originally in the pre-released Marp, it has supported to resize by percentage keyword relative to image size. It is realized by using zoom CSS property. However, it does not support in Firefox. Marpit cannot adopt the same way because of supporting cross-browser.

As the alternative way, we will support width & height keyword and w & h shorthands. You can specify these CSS declarations by the absolute unit.

![width:250px height:300px](image.png)
![w:250 h:300](image.png)

We had supported percentage value at first, but it doesn't support now. The percentage styling would not cause reflow with an incremental update in Firefox.

In regular background images, It also can use as the shortcut of backgroundSize spot directive. It also can use percentage value.

![bg w:50% h:75%](background.png)

In advanced backgrounds, the size of each image could specify separately.

ToDo

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