[csswg-drafts] Add margin to ScrollIntoViewOptions

davidbukacek has just created a new issue for https://github.com/w3c/csswg-drafts:

==  Add margin to ScrollIntoViewOptions ==
Alignment to the edge of the element may not always be fully desirable. Therefore, it would be good if we could affect the position by specific margin.

Margin would work on a similar principle as rootMargin of the IntersectionObserver method (https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin)

Possible use
<pre>
element.scrollIntoView({block: 'end', inline: 'end' margin: '0 10px 0 10px'});
element.scrollIntoView({block: 'start', inline: 'start', margin: '50% 0 50%'});
</pre>

Specification: https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2730 using your GitHub account

Received on Friday, 1 June 2018 11:30:46 UTC