Sidebar.module.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. @use '@growi/core-styles/scss/bootstrap/init' as bs;
  2. @use '~/styles/variables' as var;
  3. @use '~/styles/mixins';
  4. .grw-sidebar :global {
  5. top: 0;
  6. }
  7. // TODO: commonize reload button style
  8. .grw-sidebar :global {
  9. .grw-sidebar-content-header {
  10. .grw-btn-reload {
  11. font-size: 16px;
  12. }
  13. }
  14. }
  15. // Dock Mode
  16. .grw-sidebar {
  17. &:global {
  18. &.grw-sidebar-dock {
  19. position: sticky;
  20. }
  21. }
  22. }
  23. // Collapsed Mode
  24. .grw-sidebar {
  25. &:global {
  26. &.grw-sidebar-collapsed {
  27. position: sticky;
  28. .sidebar-contents-container {
  29. border-color: var(--bs-border-color);
  30. border-style: solid;
  31. border-width : 1px 1px 1px 0;
  32. }
  33. // open
  34. .sidebar-contents-container.open {
  35. position: absolute;
  36. left: var.$grw-sidebar-nav-width;
  37. min-height: 50vh;
  38. max-height: calc(100vh - var.$grw-sidebar-nav-width * 2);
  39. border-radius: 0 4px 4px 0 ;
  40. .simple-scrollbar {
  41. max-height: inherit;
  42. }
  43. }
  44. }
  45. }
  46. }
  47. // Drawer Mode
  48. .grw-sidebar {
  49. &:global {
  50. &.grw-sidebar-drawer {
  51. position: fixed;
  52. z-index: bs.$zindex-fixed + 2;
  53. width: 348px;
  54. // apply transition
  55. transition-property: transform;
  56. @include mixins.apply-navigation-transition();
  57. &:not(.open) {
  58. transform: translateX(-100%);
  59. }
  60. &.open {
  61. z-index: bs.$zindex-modal;
  62. transform: translateX(0);
  63. }
  64. }
  65. }
  66. }
  67. .grw-sidebar :global {
  68. // overwrite simplebar-react css
  69. .simplebar-scrollbar::before {
  70. background-color:var(--bs-gray-500);
  71. }
  72. }
  73. @include bs.color-mode(light) {
  74. .grw-sidebar :global {
  75. --bs-border-color: var(--grw-highlight-200);
  76. .sidebar-contents-container {
  77. background-color: color-mix(in srgb, var(--grw-highlight-100), var(--bs-body-bg));
  78. }
  79. }
  80. // frosted glass effect in collapsed mode
  81. .grw-sidebar {
  82. &:global {
  83. &.grw-sidebar-collapsed {
  84. .sidebar-contents-container {
  85. background-color: rgba(var(--grw-highlight-100-rgb), .8);
  86. backdrop-filter: blur(20px);
  87. }
  88. }
  89. }
  90. }
  91. }
  92. @include bs.color-mode(dark) {
  93. .grw-sidebar :global {
  94. --bs-color: var(--bs-gray-400);
  95. --bs-border-color: var(--grw-highlight-800);
  96. .sidebar-contents-container {
  97. background-color: color-mix(in srgb, var(--grw-highlight-800), var(--bs-body-bg));
  98. }
  99. }
  100. // frosted glass effect in collapsed mode
  101. .grw-sidebar {
  102. &:global {
  103. &.grw-sidebar-collapsed {
  104. .sidebar-contents-container {
  105. background-color: rgba(var(--grw-highlight-800-rgb), .8);
  106. backdrop-filter: blur(20px);
  107. }
  108. }
  109. }
  110. }
  111. }