_sidebar.scss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. transition: left 300ms cubic-bezier(0.25, 1, 0.5, 1);
  64. // css-xxx-ContainerNavigationMask
  65. > div:nth-of-type(1) {
  66. }
  67. // css-xxx-Outer
  68. > div:nth-of-type(2) {
  69. z-index: 100; // greater than the value of slimScrollBar
  70. width: 0;
  71. transform: unset; // unset for 'position: fixed' of .ak-navigation-resize-button
  72. // css-xxx-Shadow
  73. > div:first-child {
  74. 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%);
  75. }
  76. }
  77. }
  78. .grw-sidebar-nav {
  79. height: 100vh;
  80. max-height: calc(100vh - #{$grw-navbar-border-width});
  81. .btn {
  82. width: $grw-sidebar-nav-width;
  83. line-height: 1em;
  84. border-radius: 0;
  85. // icon opacity
  86. &:not(.active) {
  87. i {
  88. opacity: 0.4;
  89. }
  90. &:hover,
  91. &:focus {
  92. i {
  93. opacity: 0.7;
  94. }
  95. }
  96. }
  97. }
  98. .grw-sidebar-nav-primary-container {
  99. .btn {
  100. padding: 1em;
  101. i {
  102. font-size: 2.3em;
  103. }
  104. &.active {
  105. @extend %fukidashi-for-active;
  106. }
  107. }
  108. }
  109. .grw-sidebar-nav-secondary-container {
  110. position: fixed;
  111. bottom: 1.5rem;
  112. .btn {
  113. padding: 0.9em;
  114. i {
  115. font-size: 1.5em;
  116. }
  117. }
  118. }
  119. }
  120. }
  121. // Drawer Mode
  122. @mixin drawer() {
  123. z-index: $zindex-fixed - 2;
  124. // override @atlaskit/navigation-next styles
  125. div[data-layout-container='true'] {
  126. // css-teprsg
  127. > div:nth-of-type(2) {
  128. display: none;
  129. }
  130. }
  131. div[data-testid='Navigation'] {
  132. position: fixed;
  133. // css-xxx-Outer
  134. > div:nth-of-type(2) {
  135. display: none;
  136. }
  137. }
  138. &:not(.open) {
  139. div[data-testid='Navigation'] {
  140. left: -#{$grw-sidebar-nav-width + $grw-sidebar-content-min-width};
  141. }
  142. }
  143. &.open {
  144. div[data-testid='Navigation'] {
  145. left: 0;
  146. }
  147. }
  148. }
  149. .grw-sidebar {
  150. &.grw-sidebar-drawer {
  151. @include drawer();
  152. }
  153. @include media-breakpoint-down(sm) {
  154. @include drawer();
  155. }
  156. }
  157. // supress transition
  158. .grw-sidebar {
  159. &.grw-sidebar-supress-transitions-to-drawer {
  160. div[data-testid='Navigation'] {
  161. transition: none !important;
  162. }
  163. }
  164. &.grw-sidebar-supress-transitions-to-dock {
  165. div[data-testid='Content'],
  166. div[data-testid='ContextualNavigation'] {
  167. transition: none !important;
  168. }
  169. }
  170. }
  171. .grw-sidebar-backdrop.modal-backdrop {
  172. z-index: $zindex-fixed - 4;
  173. }