// Name:            Sticky
// Description:     Make elements remain at the top of the viewport
//
// Component:       `data-wk-sticky`
//
// States:          `wk-active`
//
// ========================================================================


// Variables
// ========================================================================

@sticky-z-index:                                980;

@sticky-animation-duration:                     0.2s;
@sticky-reverse-animation-duration:             0.2s;


/* ========================================================================
   Component: Sticky
 ========================================================================== */

/*
 * 1. More robust if padding and border are used
 * 2. Enable hardware acceleration for iOS browsers, resolves scrolling issue
 */

[data-wk-sticky].wk-active {
   z-index: @sticky-z-index;
   /* 1 */
   box-sizing: border-box;
   /* 2 */
   -webkit-backface-visibility: hidden
}

/*
 * Faster animations
 */

[data-wk-sticky][class*='wk-animation-'] {
    -webkit-animation-duration: @sticky-animation-duration;
    animation-duration: @sticky-animation-duration;
}

[data-wk-sticky].wk-animation-reverse {
    -webkit-animation-duration: @sticky-reverse-animation-duration;
    animation-duration: @sticky-reverse-animation-duration;
}


// Hooks
// ========================================================================

.hook-sticky-misc;

.hook-sticky-misc() {}
