You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.4 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. // stylelint-disable function-disallowed-list
  2. %offcanvas-css-vars {
  3. // scss-docs-start offcanvas-css-vars
  4. --#{$prefix}offcanvas-zindex: #{$zindex-offcanvas};
  5. --#{$prefix}offcanvas-width: #{$offcanvas-horizontal-width};
  6. --#{$prefix}offcanvas-height: #{$offcanvas-vertical-height};
  7. --#{$prefix}offcanvas-padding-x: #{$offcanvas-padding-x};
  8. --#{$prefix}offcanvas-padding-y: #{$offcanvas-padding-y};
  9. --#{$prefix}offcanvas-color: #{$offcanvas-color};
  10. --#{$prefix}offcanvas-bg: #{$offcanvas-bg-color};
  11. --#{$prefix}offcanvas-border-width: #{$offcanvas-border-width};
  12. --#{$prefix}offcanvas-border-color: #{$offcanvas-border-color};
  13. --#{$prefix}offcanvas-box-shadow: #{$offcanvas-box-shadow};
  14. // scss-docs-end offcanvas-css-vars
  15. }
  16. @each $breakpoint in map-keys($grid-breakpoints) {
  17. $next: breakpoint-next($breakpoint, $grid-breakpoints);
  18. $infix: breakpoint-infix($next, $grid-breakpoints);
  19. .offcanvas#{$infix} {
  20. @extend %offcanvas-css-vars;
  21. }
  22. }
  23. @each $breakpoint in map-keys($grid-breakpoints) {
  24. $next: breakpoint-next($breakpoint, $grid-breakpoints);
  25. $infix: breakpoint-infix($next, $grid-breakpoints);
  26. .offcanvas#{$infix} {
  27. @include media-breakpoint-down($next) {
  28. position: fixed;
  29. bottom: 0;
  30. z-index: var(--#{$prefix}offcanvas-zindex);
  31. display: flex;
  32. flex-direction: column;
  33. max-width: 100%;
  34. color: var(--#{$prefix}offcanvas-color);
  35. visibility: hidden;
  36. background-color: var(--#{$prefix}offcanvas-bg);
  37. background-clip: padding-box;
  38. outline: 0;
  39. @include box-shadow(var(--#{$prefix}offcanvas-box-shadow));
  40. @include transition(transform $offcanvas-transition-duration ease-in-out);
  41. &.offcanvas-start {
  42. top: 0;
  43. left: 0;
  44. width: var(--#{$prefix}offcanvas-width);
  45. border-right: var(--#{$prefix}offcanvas-border-width) solid var(--#{$prefix}offcanvas-border-color);
  46. transform: translateX(-100%);
  47. }
  48. &.offcanvas-end {
  49. top: 0;
  50. right: 0;
  51. width: var(--#{$prefix}offcanvas-width);
  52. border-left: var(--#{$prefix}offcanvas-border-width) solid var(--#{$prefix}offcanvas-border-color);
  53. transform: translateX(100%);
  54. }
  55. &.offcanvas-top {
  56. top: 0;
  57. right: 0;
  58. left: 0;
  59. height: var(--#{$prefix}offcanvas-height);
  60. max-height: 100%;
  61. border-bottom: var(--#{$prefix}offcanvas-border-width) solid var(--#{$prefix}offcanvas-border-color);
  62. transform: translateY(-100%);
  63. }
  64. &.offcanvas-bottom {
  65. right: 0;
  66. left: 0;
  67. height: var(--#{$prefix}offcanvas-height);
  68. max-height: 100%;
  69. border-top: var(--#{$prefix}offcanvas-border-width) solid var(--#{$prefix}offcanvas-border-color);
  70. transform: translateY(100%);
  71. }
  72. &.showing,
  73. &.show:not(.hiding) {
  74. transform: none;
  75. }
  76. &.showing,
  77. &.hiding,
  78. &.show {
  79. visibility: visible;
  80. }
  81. }
  82. @if not ($infix == "") {
  83. @include media-breakpoint-up($next) {
  84. --#{$prefix}offcanvas-height: auto;
  85. --#{$prefix}offcanvas-border-width: 0;
  86. background-color: transparent !important; // stylelint-disable-line declaration-no-important
  87. .offcanvas-header {
  88. display: none;
  89. }
  90. .offcanvas-body {
  91. display: flex;
  92. flex-grow: 0;
  93. padding: 0;
  94. overflow-y: visible;
  95. // Reset `background-color` in case `.bg-*` classes are used in offcanvas
  96. background-color: transparent !important; // stylelint-disable-line declaration-no-important
  97. }
  98. }
  99. }
  100. }
  101. }
  102. .offcanvas-backdrop {
  103. @include overlay-backdrop($zindex-offcanvas-backdrop, $offcanvas-backdrop-bg, $offcanvas-backdrop-opacity);
  104. }
  105. .offcanvas-header {
  106. display: flex;
  107. align-items: center;
  108. justify-content: space-between;
  109. padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x);
  110. .btn-close {
  111. padding: calc(var(--#{$prefix}offcanvas-padding-y) * .5) calc(var(--#{$prefix}offcanvas-padding-x) * .5);
  112. margin-top: calc(-.5 * var(--#{$prefix}offcanvas-padding-y));
  113. margin-right: calc(-.5 * var(--#{$prefix}offcanvas-padding-x));
  114. margin-bottom: calc(-.5 * var(--#{$prefix}offcanvas-padding-y));
  115. }
  116. }
  117. .offcanvas-title {
  118. margin-bottom: 0;
  119. line-height: $offcanvas-title-line-height;
  120. }
  121. .offcanvas-body {
  122. flex-grow: 1;
  123. padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x);
  124. overflow-y: auto;
  125. }