_sidebar.scss 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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. .ak-navigation-resize-button {
  22. position: fixed;
  23. // locate to the center of screen
  24. top: calc(50vh - 20px);
  25. /*
  26. * styles
  27. */
  28. // unset originalhover color
  29. > div:hover {
  30. background-color: unset;
  31. }
  32. $box-shadow: 0 1px 1px rgba(96, 96, 96, 0.75);
  33. @include hexagonize(24px, white, $box-shadow);
  34. // rotate 30deg
  35. transform: translate(-50%) rotate(30deg);
  36. > div,
  37. > span svg {
  38. transform: rotate(-30deg);
  39. }
  40. // centering icon
  41. > span svg {
  42. position: relative;
  43. z-index: 1;
  44. margin-top: -5.5px;
  45. }
  46. }
  47. // override @atlaskit/navigation-next styles
  48. $navbar-total-height: $grw-navbar-height + $grw-navbar-border-width;
  49. div[data-layout-container='true'] {
  50. // css-teprsg
  51. > div:nth-of-type(2) {
  52. padding-left: unset !important;
  53. margin-left: unset !important;
  54. }
  55. }
  56. div[data-testid='Navigation'] {
  57. // css-xxx-ContainerNavigationMask
  58. > div:nth-of-type(1) {
  59. }
  60. // css-xxx-Outer
  61. > div:nth-of-type(2) {
  62. z-index: 100; // greater than the value of slimScrollBar
  63. width: 0;
  64. transform: unset; // unset for 'position: fixed' of .ak-navigation-resize-button
  65. // css-xxx-Shadow
  66. > div:first-child {
  67. 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%);
  68. }
  69. }
  70. }
  71. .grw-sidebar-nav {
  72. min-width: 62px;
  73. height: 100vh;
  74. .btn {
  75. width: $grw-sidebar-nav-width;
  76. line-height: 1em;
  77. border-radius: 0;
  78. // icon opacity
  79. &:not(.active) {
  80. i {
  81. opacity: 0.4;
  82. }
  83. &:hover,
  84. &:focus {
  85. i {
  86. opacity: 0.7;
  87. }
  88. }
  89. }
  90. }
  91. .grw-sidebar-nav-primary-container {
  92. .btn {
  93. padding: 1em;
  94. i {
  95. font-size: 2.3em;
  96. }
  97. &.active {
  98. @extend %fukidashi-for-active;
  99. }
  100. }
  101. }
  102. .grw-sidebar-nav-secondary-container {
  103. position: fixed;
  104. bottom: 1.5rem;
  105. .btn {
  106. padding: 0.9em;
  107. i {
  108. font-size: 1.5em;
  109. }
  110. }
  111. }
  112. }
  113. .grw-drawer-toggler {
  114. display: none; // invisible in default
  115. }
  116. .grw-sidebar-content-header {
  117. .grw-btn-reload {
  118. font-size: 18px;
  119. }
  120. }
  121. }
  122. // Dock Mode
  123. @mixin dock() {
  124. z-index: $zindex-sticky;
  125. // override @atlaskit/navigation-next styles
  126. $navbar-total-height: $grw-navbar-height + $grw-navbar-border-width;
  127. div[data-layout-container='true'] {
  128. max-height: calc(100vh - #{$grw-navbar-border-width});
  129. }
  130. div[data-testid='Navigation'] {
  131. position: unset;
  132. top: $navbar-total-height;
  133. }
  134. }
  135. // Drawer Mode
  136. @mixin drawer() {
  137. z-index: $zindex-fixed + 2;
  138. // override @atlaskit/navigation-next styles
  139. div[data-testid='Navigation'] {
  140. max-width: 80vw;
  141. // apply transition
  142. transition-property: transform;
  143. @include apply-navigation-transition();
  144. }
  145. &:not(.open) {
  146. div[data-testid='Navigation'] {
  147. transform: translateX(-100%);
  148. }
  149. }
  150. &.open {
  151. div[data-testid='Navigation'] {
  152. transform: translateX(0);
  153. }
  154. .grw-drawer-toggler {
  155. display: block;
  156. }
  157. }
  158. .grw-drawer-toggler {
  159. position: fixed;
  160. right: -15px;
  161. @include media-breakpoint-down(sm) {
  162. bottom: 15px;
  163. width: 42px;
  164. height: 42px;
  165. font-size: 18px;
  166. }
  167. @include media-breakpoint-up(md) {
  168. top: 72px;
  169. width: 50px;
  170. height: 50px;
  171. font-size: 24px;
  172. }
  173. transform: translateX(100%);
  174. }
  175. }
  176. .grw-sidebar {
  177. @include media-breakpoint-down(sm) {
  178. @include drawer();
  179. }
  180. @include media-breakpoint-up(md) {
  181. &.grw-sidebar-drawer {
  182. @include drawer();
  183. }
  184. &:not(.grw-sidebar-drawer) {
  185. @include dock();
  186. }
  187. }
  188. }
  189. // supress transition
  190. .grw-sidebar {
  191. &.grw-sidebar-supress-transitions-to-drawer {
  192. div[data-testid='Navigation'] {
  193. transition: none !important;
  194. }
  195. }
  196. &.grw-sidebar-supress-transitions-to-dock {
  197. div[data-testid='Content'],
  198. div[data-testid='ContextualNavigation'] {
  199. transition: none !important;
  200. }
  201. }
  202. }
  203. .grw-sidebar-backdrop.modal-backdrop {
  204. z-index: $zindex-fixed + 1;
  205. }