w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.37k stars 642 forks source link

[cssom-view][css-scroll-snap] State scrollport and target scroll-snap properties effects in cssom for SIV and jump links #2428

Open jonjohnjohnson opened 6 years ago

jonjohnjohnson commented 6 years ago

https://drafts.csswg.org/cssom-view-1/

Though I find disparate mentions of scroll-padding/scroll-margin values being used in scroll position decision making for scrollIntoView and general "jump links", I see implementations of css-scroll-snap not going so far as enabling the properties effects outside of snapports.

In hopes that we can get rid of hacks like...

.target-sentinel-for-reference     { position: relative; top: -3rem; }
.target-sentinel-for-section-title { position: relative; top: -6rem; }

In relation to articles like...

I think these properties should be referenced/highlighted in cssom-view?

Edited - Blink has now enabled these properties for use outside of snapports, though only in the block (or maybe just vertical) axis.

Malvoz commented 6 years ago

I resort to these type of hacks all the time, but alot of authors don't, and you end up scrolling past a heading usually on pages with a position fixed header which can be pretty awkward especially if you clicked a url fragment so you have to scroll up again just to read the heading.

jonjohnjohnson commented 5 years ago

@fantasai Again, if you think that #3721 makes it now clear enough in css-scroll-snap (regardless of cssom-view), for vendors implementing that spec, to enable these properties effects outside of snapports, then this issue can be closed. I just want it clear so that there is no confusion when filing bugs against the different vendors for these effects.