Sidebar.module.scss 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. @use '~/styles/mixins';
  2. @use '@growi/core/scss/bootstrap/init' as bs;
  3. .grw-sidebar :global {
  4. // sticky
  5. position: sticky;
  6. top: 0;
  7. // set the max value that should be taken when sticky
  8. height: 100vh;
  9. border-right : 1px solid var(--bs-border-color);
  10. .data-layout-container {
  11. display: flex;
  12. flex-direction: row;
  13. height: 100vh;
  14. margin-top: 0px;
  15. }
  16. .navigation {
  17. .grw-navigation-wrap {
  18. display: flex;
  19. flex-direction: row;
  20. height: 100%;
  21. overflow: hidden;
  22. .grw-contextual-navigation {
  23. position: relative;
  24. width: 240px;
  25. height: 100%;
  26. &:not(.dragging) {
  27. transition: width 200ms cubic-bezier(0.2, 0, 0, 1) 0s;
  28. }
  29. will-change: width;
  30. .grw-contextual-navigation-child {
  31. height: 100%;
  32. overflow-x: hidden;
  33. }
  34. .grw-drawer-toggler {
  35. display: none; // invisible in default
  36. }
  37. }
  38. .simplebar-mask {
  39. z-index: 110; // greater than the value of .grw-navigation-draggable to fix https://redmine.weseek.co.jp/issues/86678
  40. }
  41. }
  42. .grw-navigation-draggable {
  43. position: absolute;
  44. top: 0px;
  45. bottom: 0px;
  46. left: 100%;
  47. z-index: 10; // greater than the value of SimpleBar
  48. width: 0;
  49. .grw-navigation-draggable-hitarea {
  50. position: relative;
  51. left: -4px;
  52. width: 24px;
  53. height: 100%;
  54. cursor: ew-resize;
  55. .grw-navigation-draggable-hitarea-child {
  56. position: absolute;
  57. left: 3px;
  58. display: none;
  59. width: 2px;
  60. height: 100%;
  61. background-color: rgb(76, 154, 255);
  62. }
  63. }
  64. .grw-navigation-resize-button {
  65. position: fixed;
  66. $width: 27.691px;
  67. $height: 23.999px;
  68. @mixin hitarea($size-hitarea) {
  69. top: ($width - $size-hitarea) / 2;
  70. left: ($height - $size-hitarea) / 2;
  71. width: $size-hitarea;
  72. height: $size-hitarea;
  73. }
  74. // locate to the center of screen
  75. top: calc(50vh - $height/2);
  76. display: none;
  77. padding: 0px;
  78. background-color: transparent;
  79. border: 0;
  80. transform: translateX(-50%);
  81. .hexagon-container {
  82. // set transform
  83. svg * {
  84. transition: fill 100ms linear;
  85. }
  86. svg {
  87. width: $width + 2px; // add 1px for drop-shadow
  88. height: $height + 2px; // add 1px for drop-shadow
  89. .background {
  90. filter: drop-shadow(0px 1px 0px rgba(#999, 60%));
  91. }
  92. }
  93. }
  94. .hitarea {
  95. position: absolute;
  96. border-radius: bs.$border-radius-pill;
  97. @include hitarea(30px);
  98. }
  99. // reverse and center icon at the time of collapsed
  100. &.collapsed {
  101. display: block;
  102. .hexagon-container svg {
  103. transform: rotate(180deg);
  104. }
  105. .hitarea {
  106. @include hitarea(80px);
  107. }
  108. }
  109. }
  110. &:hover {
  111. .grw-navigation-draggable-hitarea-child {
  112. display: block;
  113. }
  114. .grw-navigation-resize-button {
  115. display: block;
  116. }
  117. }
  118. }
  119. }
  120. .grw-sidebar-content-header {
  121. .grw-btn-reload {
  122. font-size: 18px;
  123. }
  124. }
  125. }
  126. // Dock Mode
  127. @mixin dock() {
  128. }
  129. // Drawer Mode
  130. @mixin drawer() {
  131. z-index: bs.$zindex-fixed + 2;
  132. .data-layout-container {
  133. position: fixed;
  134. top: 0;
  135. width: 0;
  136. }
  137. div.navigation.transition-enabled {
  138. max-width: 80vw;
  139. // apply transition
  140. transition-property: transform;
  141. @include mixins.apply-navigation-transition();
  142. }
  143. &:not(.open) {
  144. div.navigation {
  145. transform: translateX(-100%);
  146. }
  147. }
  148. &.open {
  149. div.navigation {
  150. transform: translateX(0);
  151. }
  152. .grw-contextual-navigation-child {
  153. .grw-drawer-toggler {
  154. display: block;
  155. }
  156. }
  157. }
  158. .grw-navigation-resize-button {
  159. display: none !important;
  160. }
  161. .grw-contextual-navigation-child {
  162. .grw-drawer-toggler {
  163. @include bs.media-breakpoint-down(sm) {
  164. position: fixed;
  165. right: -15px;
  166. bottom: 15px;
  167. width: 42px;
  168. height: 42px;
  169. font-size: 18px;
  170. transform: translateX(100%);
  171. }
  172. }
  173. }
  174. }
  175. .grw-sidebar {
  176. &:global {
  177. &.grw-sidebar-drawer {
  178. @include drawer();
  179. }
  180. &.grw-sidebar-dock {
  181. @include bs.media-breakpoint-down(sm) {
  182. @include drawer();
  183. }
  184. @include bs.media-breakpoint-up(md) {
  185. @include dock();
  186. }
  187. }
  188. }
  189. }
  190. .grw-sidebar :global {
  191. .grw-contextual-navigation {
  192. backdrop-filter: blur(20px);
  193. }
  194. }
  195. @include bs.color-mode(light) {
  196. .grw-sidebar :global {
  197. --bs-border-color: var(--grw-highlight-200);
  198. .grw-contextual-navigation {
  199. background-color: rgba(var(--grw-highlight-100-rgb), .5);
  200. }
  201. }
  202. }
  203. @include bs.color-mode(dark) {
  204. .grw-sidebar :global {
  205. --bs-color: var(--bs-gray-400);
  206. --bs-border-color: var(--grw-highlight-800);
  207. .grw-contextual-navigation {
  208. background-color: rgba(var(--grw-highlight-800-rgb), .5);
  209. }
  210. }
  211. }