_sidebar.scss 7.5 KB

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