Slideout
C Slideout
A CSS component for displaying off canvas content that slides out from the left or right. This component must be used with
.sidebar,.tbar.tbar-stackedor both.The modifiers
c-slideout-fixedandc-slideout-absolutesetsposition: fixed;andposition: absolute;onc-slideout, respectively.The modifiers
c-slideout-startandc-slideout-endpositions the slideout on the left and right, respectively. It also setsdisplayand positionssidebarandtbarcomponents so the animations can be rendered properly.
On Open
Add the classes
c-slideout-transition c-slideout-transition-inonsidebarandtbar.If rendering a push style animation, add the class
c-slideout-pushorc-slideout-push-tbartoc-slideoutdepending on the type of push style you need. Then add the classesc-slideout-transition c-slideout-transition-into the parent element.After the browser applies the transition styles, add the class
c-slideout-showonsidebarandtbar.For push style animation add
padding-leftorpadding-rightto the parent element with the width ofc-slideout.On
transitionend, remove the classesc-slideout-transition c-slideout-transition-infromsidebar,tbar, and the parent element. Then add the classc-slideout-showntoc-slideout. If showing atbaradd the classc-slideout-tbar-showntoc-slideout. This ensures the transition stays smooth when rendering a push style transition.
On Close
If closing both, add the class
c-slideout-transition c-slideout-transition-outonsidebarandtbarand remove the classesc-slideout-shown c-slideout-tbar-shownfromc-slideout.If closing only
sidebar, addc-slideout-transition c-slideout-transition-outto that.If rendering a push style animation, add the class
c-slideout-transition c-slideout-transition-outto the parent element.After the browser applies the transition styles, remove the class
c-slideout-showonsidebarand/ortbar.For push style animation remove
padding-leftorpadding-rightfrom the parent element.On
transitionend, remove the classc-slideout-transition c-slideout-transition-outfromsidebar,tbar, and parent element.