Summary Files Commits Branches @commit @diff @stats
path: root / src / _off-canvas.scss
blob: f3b8b9f1c603f765661f90e52d626fae31c48585 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Off canvas menus
$off-canvas-breakpoint: $size-lg !default;

.off-canvas {
  display: flex;
  flex-flow: nowrap;
  height: 100%;
  position: relative;
  width: 100%;

  .off-canvas-toggle {
    display: block;
    position: absolute;
    top: $layout-spacing;
    transition: none;
    z-index: $zindex-0;
    @if $rtl == true {
      right: $layout-spacing;
    } @else {
      left: $layout-spacing;
    }
  }

  .off-canvas-sidebar {
    background: $bg-color;
    bottom: 0;
    min-width: 10rem;
    overflow-y: auto;
    position: fixed;
    top: 0;
    transition: transform .25s;
    z-index: $zindex-2;
    @if $rtl == true {
      right: 0;
      transform: translateX(100%);
    } @else {
      left: 0;
      transform: translateX(-100%);
    }
  }

  .off-canvas-content {
    flex: 1 1 auto;
    height: 100%;
    padding: $layout-spacing $layout-spacing $layout-spacing 4rem;
  }

  .off-canvas-overlay {
    background: rgba($dark-color, .1);
    border-color: transparent;
    border-radius: 0;
    bottom: 0;
    display: none;
    height: 100%;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
  }

  .off-canvas-sidebar {
    &:target,
    &.active {
      transform: translateX(0);
    }

    &:target ~ .off-canvas-overlay,
    &.active ~ .off-canvas-overlay {
      display: block;
      z-index: $zindex-1;
    }
  }
}

// Responsive layout
@media (min-width: $off-canvas-breakpoint) {
  .off-canvas {
    &.off-canvas-sidebar-show {
      .off-canvas-toggle {
        display: none;
      }
  
      .off-canvas-sidebar {
        flex: 0 0 auto;
        position: relative;
        transform: none;
      }

      .off-canvas-overlay {
        display: none !important;
      }
    }
  }
}