argyleink / open-props

CSS custom properties to help accelerate adaptive and consistent design.
https://open-props.style
MIT License
4.8k stars 192 forks source link

Enable smooth scrolling for nested scrollers also #460

Open argyleink opened 10 months ago

argyleink commented 10 months ago

Currently the style only applies to the root scroller html, missing nested scrollers. This will match any of them that use url hash targets inside. Also adds scroll padding. Nice use case shown by Kevin here.

@media (--motionOK) {
  :where(:has(:target)) {
    scroll-behavior: smooth;
    scroll-padding-block-start: max(2rem, 5svb);
  }
}