_sidebar.scss 7.4 KB

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