_sidebar.scss 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. .grw-sidebar {
  2. $sidebar-nav-button-height: 55px;
  3. %fukidashi-for-active {
  4. position: relative;
  5. // speech balloon
  6. &:after {
  7. position: absolute;
  8. right: -0.1em;
  9. display: block;
  10. width: 0;
  11. content: '';
  12. border: 9px solid transparent;
  13. border-right-color: white;
  14. border-left-width: 0;
  15. transform: translateY(-#{$sidebar-nav-button-height / 2});
  16. }
  17. }
  18. // sticky
  19. position: sticky;
  20. top: $grw-navbar-border-width;
  21. z-index: $zindex-sticky;
  22. .ak-navigation-resize-button {
  23. position: fixed;
  24. // locate to the center of screen
  25. top: calc(50vh - 20px);
  26. /*
  27. * styles
  28. */
  29. // unset originalhover color
  30. > div:hover {
  31. background-color: unset;
  32. }
  33. $box-shadow: 0 1px 1px rgba(96, 96, 96, 0.75);
  34. @include hexagonize(24px, white, $box-shadow);
  35. // rotate 30deg
  36. transform: translate(-50%) rotate(30deg);
  37. > div,
  38. > span svg {
  39. transform: rotate(-30deg);
  40. }
  41. // centering icon
  42. > span svg {
  43. position: relative;
  44. z-index: 1;
  45. margin-top: -5.5px;
  46. }
  47. }
  48. // override @atlaskit/navigation-next styles
  49. $navbar-total-height: $grw-navbar-height + $grw-navbar-border-width;
  50. div[data-layout-container='true'] {
  51. max-height: calc(100vh - #{$grw-navbar-border-width});
  52. // css-teprsg
  53. > div:nth-of-type(2) {
  54. padding-left: unset !important;
  55. margin-left: unset !important;
  56. }
  57. }
  58. div[data-testid='Navigation'] {
  59. position: unset;
  60. top: $navbar-total-height;
  61. // Adjust to be on top of the growi subnavigation
  62. // z-index: $zindex-sticky + 5;
  63. // css-xxx-ContainerNavigationMask
  64. > div:nth-of-type(1) {
  65. }
  66. // css-xxx-Outer
  67. > div:nth-of-type(2) {
  68. z-index: 100; // greater than the value of slimScrollBar
  69. width: 0;
  70. transform: unset; // unset for 'position: fixed' of .ak-navigation-resize-button
  71. // css-xxx-Shadow
  72. > div:first-child {
  73. background: linear-gradient(to left, rgba(0, 0, 0, 0.1) 0px, rgba(0, 0, 0, 0.1) 1px, rgba(0, 0, 0, 0.1) 1px, rgba(0, 0, 0, 0) 100%);
  74. }
  75. }
  76. }
  77. .grw-sidebar-nav {
  78. height: 100vh;
  79. max-height: calc(100vh - #{$grw-navbar-border-width});
  80. .btn {
  81. width: $grw-sidebar-nav-width;
  82. line-height: 1em;
  83. border-radius: 0;
  84. // icon opacity
  85. &:not(.active) {
  86. i {
  87. opacity: 0.4;
  88. }
  89. &:hover,
  90. &:focus {
  91. i {
  92. opacity: 0.7;
  93. }
  94. }
  95. }
  96. }
  97. .grw-sidebar-nav-primary-container {
  98. .btn {
  99. padding: 1em;
  100. i {
  101. font-size: 2.3em;
  102. }
  103. &.active {
  104. @extend %fukidashi-for-active;
  105. }
  106. }
  107. }
  108. .grw-sidebar-nav-secondary-container {
  109. position: fixed;
  110. bottom: 1.5rem;
  111. .btn {
  112. padding: 0.9em;
  113. i {
  114. font-size: 1.5em;
  115. }
  116. }
  117. }
  118. }
  119. }
  120. // Drawer Mode
  121. @mixin drawer() {
  122. z-index: $zindex-fixed + 1;
  123. // override @atlaskit/navigation-next styles
  124. div[data-layout-container='true'] {
  125. height: 100vw;
  126. }
  127. div[data-testid='Navigation'] {
  128. position: fixed;
  129. top: 0;
  130. max-width: 80vw;
  131. // apply transition
  132. transition-property: left;
  133. @include apply-navigation-transition();
  134. }
  135. &:not(.open) {
  136. div[data-testid='Navigation'] {
  137. left: -80vw;
  138. }
  139. }
  140. &.open {
  141. div[data-testid='Navigation'] {
  142. left: 0;
  143. }
  144. }
  145. }
  146. .grw-sidebar {
  147. &.grw-sidebar-drawer {
  148. @include drawer();
  149. }
  150. @include media-breakpoint-down(sm) {
  151. @include drawer();
  152. }
  153. }
  154. // supress transition
  155. .grw-sidebar {
  156. &.grw-sidebar-supress-transitions-to-drawer {
  157. div[data-testid='Navigation'] {
  158. transition: none !important;
  159. }
  160. }
  161. &.grw-sidebar-supress-transitions-to-dock {
  162. div[data-testid='Content'],
  163. div[data-testid='ContextualNavigation'] {
  164. transition: none !important;
  165. }
  166. }
  167. }
  168. .grw-sidebar-backdrop.modal-backdrop {
  169. z-index: $zindex-fixed - 4;
  170. }