PrimaryItems.module.scss 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @use '@growi/core/scss/bootstrap/init' as bs;
  2. @use '../button-styles';
  3. @use '../variables' as sidebarVar;
  4. .grw-primary-items :global {
  5. .btn {
  6. @extend %btn-basis;
  7. i {
  8. opacity: 0.7;
  9. &:hover,
  10. &:focus {
  11. opacity: 0.8;
  12. }
  13. }
  14. }
  15. }
  16. // Add indicator
  17. .grw-primary-items :global {
  18. $btn-height: sidebarVar.$grw-sidebar-button-height;
  19. $btn-active-indicator-height: 34px;
  20. .btn {
  21. &.active {
  22. position: relative;
  23. // indicator
  24. &:after {
  25. position: absolute;
  26. top: 0;
  27. left: 0;
  28. display: block;
  29. width: 3px;
  30. height: $btn-active-indicator-height;
  31. content: '';
  32. background-color: var(--bs-primary);
  33. transform: translateY(#{($btn-height - $btn-active-indicator-height) / 2});
  34. }
  35. }
  36. }
  37. }
  38. // == Colors
  39. .grw-primary-items :global {
  40. .btn.btn-primary {
  41. @extend %btn-primary-color-vars;
  42. }
  43. }
  44. @include bs.color-mode(light) {
  45. .grw-primary-items :global {
  46. .btn-primary {
  47. --bs-btn-color: var(--grw-sidebar-nav-btn-color, var(--grw-primary-600));
  48. --bs-btn-hover-bg: var(--grw-sidebar-nav-btn-hover-bg, var(--grw-highlight-300));
  49. }
  50. }
  51. }
  52. @include bs.color-mode(dark) {
  53. .grw-primary-items :global {
  54. .btn-primary {
  55. --bs-btn-color: var(--grw-sidebar-nav-btn-color, var(--grw-primary-300));
  56. --bs-btn-hover-bg: var(--grw-sidebar-nav-btn-hover-bg, var(--grw-highlight-700));
  57. }
  58. }
  59. }