Sidebar.module.scss 2.7 KB

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