Sidebar.module.scss 6.1 KB

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