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-stacked
or both.The modifiers
c-slideout-fixed
andc-slideout-absolute
setsposition: fixed;
andposition: absolute;
onc-slideout
, respectively.The modifiers
c-slideout-start
andc-slideout-end
positions the slideout on the left and right, respectively. It also setsdisplay
and positionssidebar
andtbar
components so the animations can be rendered properly.
On Open
Add the classes
c-slideout-transition c-slideout-transition-in
onsidebar
andtbar
.If rendering a push style animation, add the class
c-slideout-push
orc-slideout-push-tbar
toc-slideout
depending on the type of push style you need. Then add the classesc-slideout-transition c-slideout-transition-in
to the parent element.After the browser applies the transition styles, add the class
c-slideout-show
onsidebar
andtbar
.For push style animation add
padding-left
orpadding-right
to the parent element with the width ofc-slideout
.On
transitionend
, remove the classesc-slideout-transition c-slideout-transition-in
fromsidebar
,tbar
, and the parent element. Then add the classc-slideout-shown
toc-slideout
. If showing atbar
add the classc-slideout-tbar-shown
toc-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-out
onsidebar
andtbar
and remove the classesc-slideout-shown c-slideout-tbar-shown
fromc-slideout
.If closing only
sidebar
, addc-slideout-transition c-slideout-transition-out
to that.If rendering a push style animation, add the class
c-slideout-transition c-slideout-transition-out
to the parent element.After the browser applies the transition styles, remove the class
c-slideout-show
onsidebar
and/ortbar
.For push style animation remove
padding-left
orpadding-right
from the parent element.On
transitionend
, remove the classc-slideout-transition c-slideout-transition-out
fromsidebar
,tbar
, and parent element.