ToggleCollapseButton.module.scss 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. @use '@growi/core-styles/scss/bootstrap/init' as bs;
  2. @use 'styles/variables' as var;
  3. @use 'styles/mixins';
  4. @use '../button-styles';
  5. .btn-toggle-collapse :global {
  6. @extend %btn-basis;
  7. $height: var.$grw-sidebar-nav-width; // declare $height with the same value as the sidebar nav width
  8. height: $height;
  9. }
  10. // icon
  11. .btn-toggle-collapse :global {
  12. .material-symbols-outlined {
  13. transition: transform 0.25s;
  14. // rotation
  15. &.rotate180 {
  16. transform: rotate(180deg);
  17. }
  18. }
  19. }
  20. // Hide when editing
  21. @include mixins.at-editing() {
  22. .btn-toggle-collapse {
  23. visibility: hidden;
  24. }
  25. }
  26. // == Colors
  27. .btn-toggle-collapse {
  28. &:global {
  29. &.btn.btn-primary {
  30. @extend %btn-primary-color-vars;
  31. --bs-btn-hover-color: color-mix(in srgb, var(
  32. --grw-sidebar-nav-btn-hover-color,
  33. var(
  34. --grw-sidebar-nav-btn-color,
  35. var(--bs-btn-color)
  36. )) 90%,
  37. transparent);
  38. }
  39. }
  40. }
  41. @include bs.color-mode(light) {
  42. .btn-toggle-collapse {
  43. &:global {
  44. &.btn.btn-primary {
  45. --bs-btn-color: color-mix(in srgb, var(--grw-sidebar-nav-btn-color, var(--bs-gray-500)) 50%, transparent);
  46. --bs-btn-hover-bg: var(--grw-sidebar-nav-btn-hover-bg, var(--grw-highlight-300));
  47. }
  48. }
  49. }
  50. }
  51. @include bs.color-mode(dark) {
  52. .btn-toggle-collapse {
  53. &:global {
  54. &.btn.btn-primary {
  55. --bs-btn-color: color-mix(in srgb, var(--grw-sidebar-nav-btn-color, var(--bs-gray-600)) 50%, transparent);
  56. --bs-btn-hover-bg: var(--grw-sidebar-nav-btn-hover-bg, var(--grw-highlight-700));
  57. }
  58. }
  59. }
  60. }