_sidebar.scss 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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. // set the max value that should be taken when sticky
  22. height: calc(100vh - $grw-navbar-border-width);
  23. // override @atlaskit/navigation-next styles
  24. $navbar-total-height: $grw-navbar-height + $grw-navbar-border-width;
  25. .data-layout-container {
  26. display: flex;
  27. flex-direction: row;
  28. height: calc(100vh - 0px);
  29. margin-top: 0px;
  30. // css-teprsg
  31. > div:nth-of-type(2) {
  32. padding-left: unset !important;
  33. margin-left: unset !important;
  34. }
  35. }
  36. .navigation {
  37. .grw-navigation-wrap {
  38. display: flex;
  39. flex-direction: row;
  40. height: 100%;
  41. overflow: hidden;
  42. .grw-contextual-navigation {
  43. position: relative;
  44. width: 240px;
  45. height: 100%;
  46. &:not(.dragging) {
  47. transition: width 200ms cubic-bezier(0.2, 0, 0, 1) 0s;
  48. }
  49. will-change: width;
  50. .grw-contextual-navigation-child {
  51. position: absolute;
  52. top: 0px;
  53. left: 0px;
  54. box-sizing: border-box;
  55. width: 100%;
  56. min-width: 240px;
  57. height: 100%;
  58. overflow-x: hidden;
  59. transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
  60. transition-duration: 0.22s;
  61. transition-property: boxShadow, transform;
  62. animation-duration: 0.22s;
  63. animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
  64. animation-fill-mode: forwards;
  65. .grw-contextual-navigation-sub {
  66. box-sizing: border-box;
  67. display: flex;
  68. flex-direction: column;
  69. width: 100%;
  70. height: 100%;
  71. overflow: hidden;
  72. }
  73. }
  74. }
  75. .simplebar-mask {
  76. z-index: 110; // greater than the value of .grw-navigation-draggable to fix https://redmine.weseek.co.jp/issues/86678
  77. }
  78. }
  79. .grw-navigation-draggable {
  80. position: absolute;
  81. top: 0px;
  82. bottom: 0px;
  83. left: 100%;
  84. z-index: 10; // greater than the value of SimpleBar
  85. width: 0;
  86. .grw-navigation-draggable-hitarea {
  87. position: relative;
  88. left: -4px;
  89. width: 24px;
  90. height: 100%;
  91. cursor: ew-resize;
  92. .grw-navigation-draggable-hitarea-child {
  93. position: absolute;
  94. left: 3px;
  95. display: none;
  96. width: 2px;
  97. height: 100%;
  98. background-color: rgb(76, 154, 255);
  99. }
  100. }
  101. .grw-navigation-resize-button {
  102. position: fixed;
  103. $width: 27.691px;
  104. $height: 23.999px;
  105. @mixin hitarea($size-hitarea) {
  106. top: ($width - $size-hitarea) / 2;
  107. left: ($height - $size-hitarea) / 2;
  108. width: $size-hitarea;
  109. height: $size-hitarea;
  110. }
  111. // locate to the center of screen
  112. top: calc(50vh - $height/2);
  113. display: none;
  114. padding: 0px;
  115. background-color: transparent;
  116. border: 0;
  117. transform: translateX(-50%);
  118. .hexagon-container {
  119. // set transform
  120. svg * {
  121. transition: fill 100ms linear;
  122. }
  123. svg {
  124. width: $width + 2px; // add 1px for drop-shadow
  125. height: $height + 2px; // add 1px for drop-shadow
  126. .background {
  127. filter: drop-shadow(0px 1px 0px rgba(#999, 60%));
  128. }
  129. }
  130. }
  131. .hitarea {
  132. @extend .rounded-pill;
  133. position: absolute;
  134. @include hitarea(30px);
  135. }
  136. // reverse and center icon at the time of collapsed
  137. &.collapsed {
  138. display: block;
  139. .hexagon-container svg {
  140. transform: rotate(180deg);
  141. }
  142. .hitarea {
  143. @include hitarea(80px);
  144. }
  145. }
  146. }
  147. &:hover {
  148. .grw-navigation-draggable-hitarea-child {
  149. display: block;
  150. }
  151. .grw-navigation-resize-button {
  152. display: block;
  153. }
  154. }
  155. }
  156. }
  157. .grw-sidebar-nav {
  158. height: 100vh;
  159. .btn {
  160. width: $grw-sidebar-nav-width;
  161. line-height: 1em;
  162. border-radius: 0;
  163. box-shadow: none !important;
  164. // icon opacity
  165. &:not(.active) {
  166. i {
  167. opacity: 0.4;
  168. }
  169. &:hover,
  170. &:focus {
  171. i {
  172. opacity: 0.7;
  173. }
  174. }
  175. }
  176. }
  177. .grw-sidebar-nav-primary-container {
  178. .btn {
  179. padding: 1em;
  180. i {
  181. font-size: 2.3em;
  182. }
  183. &.active {
  184. @extend %fukidashi-for-active;
  185. }
  186. }
  187. }
  188. .grw-sidebar-nav-secondary-container {
  189. position: fixed;
  190. bottom: 1.5rem;
  191. .btn {
  192. padding: 0.9em;
  193. i {
  194. font-size: 1.5em;
  195. }
  196. }
  197. }
  198. }
  199. .grw-drawer-toggler {
  200. display: none; // invisible in default
  201. }
  202. .grw-sidebar-content-header {
  203. .grw-btn-reload {
  204. font-size: 18px;
  205. }
  206. }
  207. }
  208. // Dock Mode
  209. @mixin dock() {
  210. z-index: $zindex-sticky;
  211. // override @atlaskit/navigation-next styles
  212. $navbar-total-height: $grw-navbar-height + $grw-navbar-border-width;
  213. .data-layout-container {
  214. max-height: calc(100vh - #{$grw-navbar-border-width});
  215. }
  216. .navigation {
  217. position: unset;
  218. top: $navbar-total-height;
  219. }
  220. }
  221. // Drawer Mode
  222. @mixin drawer() {
  223. z-index: $zindex-fixed + 2;
  224. .data-layout-container {
  225. position: fixed;
  226. top: 0;
  227. width: 0;
  228. }
  229. div.navigation.transition-enabled {
  230. max-width: 80vw;
  231. // apply transition
  232. transition-property: transform;
  233. @include apply-navigation-transition();
  234. }
  235. &:not(.open) {
  236. div.navigation {
  237. transform: translateX(-100%);
  238. }
  239. }
  240. &.open {
  241. div.navigation {
  242. transform: translateX(0);
  243. }
  244. .grw-drawer-toggler {
  245. display: block;
  246. }
  247. }
  248. .grw-navigation-resize-button {
  249. display: none !important;
  250. }
  251. .grw-drawer-toggler {
  252. position: fixed;
  253. right: -15px;
  254. @include media-breakpoint-down(sm) {
  255. bottom: 15px;
  256. width: 42px;
  257. height: 42px;
  258. font-size: 18px;
  259. }
  260. @include media-breakpoint-up(md) {
  261. top: 72px;
  262. width: 50px;
  263. height: 50px;
  264. font-size: 24px;
  265. }
  266. transform: translateX(100%);
  267. }
  268. }
  269. .grw-sidebar {
  270. @include media-breakpoint-down(sm) {
  271. @include drawer();
  272. }
  273. @include media-breakpoint-up(md) {
  274. &.grw-sidebar-drawer {
  275. @include drawer();
  276. }
  277. &:not(.grw-sidebar-drawer) {
  278. @include dock();
  279. }
  280. }
  281. }
  282. .grw-sidebar-backdrop.modal-backdrop {
  283. z-index: $zindex-fixed + 1;
  284. }
  285. // style to apply when displaying search page
  286. .growi.on-search {
  287. // set sidebar height shown in search page
  288. $search-page-sidebar-height: calc(100vh - ($grw-navbar-height + $grw-navbar-border-width));
  289. .grw-sidebar {
  290. height: $search-page-sidebar-height;
  291. .data-layout-container {
  292. height: 100%;
  293. }
  294. }
  295. }