hbstack / hb

The core module of HB framework, which automatically load and compile module's TypeScript and SCSS.
https://hbstack.dev/
MIT License
18 stars 3 forks source link

feat: add the top offset mixin and CSS variable #67

Closed razonyang closed 1 year ago

razonyang commented 1 year ago

The --#{$prefix}top-offset CSS variable is used by the top property with the sticky and absolute positions.

.my-sticky-element {
  @include top-offset(sticky);
}

You can also use the hb-top-offset with position-sticky utilities class.

<div class="my-sticky-element position-sticky hb-top-offset"></div>

The former is useful for specified media query.