PrimaryItems.module.scss 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. @use '@growi/core/scss/bootstrap/init' as bs;
  2. @use '~/styles/variables' as var;
  3. @use './button-styles';
  4. .grw-primary-items :global {
  5. .btn {
  6. @extend %btn-primary-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-active-indicator-height: 34px;
  19. .btn {
  20. &.active {
  21. position: relative;
  22. // indicator
  23. &:after {
  24. position: absolute;
  25. top: 0;
  26. left: 0;
  27. display: block;
  28. width: 3px;
  29. height: $btn-active-indicator-height;
  30. content: '';
  31. background-color: var(--bs-primary);
  32. transform: translateY(#{(var.$grw-sidebar-nav-height - $btn-active-indicator-height) / 2});
  33. }
  34. }
  35. }
  36. }
  37. // == Colors
  38. .grw-primary-items :global {
  39. .btn.btn-primary {
  40. @extend %btn-primary-color-vars;
  41. }
  42. }
  43. @include bs.color-mode(light) {
  44. .grw-primary-items :global {
  45. .btn-primary {
  46. --bs-btn-color: var(--grw-sidebar-nav-btn-color, var(--grw-primary-600));
  47. --bs-btn-hover-bg: var(--grw-sidebar-nav-btn-hover-bg, var(--grw-highlight-300));
  48. }
  49. }
  50. }
  51. @include bs.color-mode(dark) {
  52. .grw-primary-items :global {
  53. .btn-primary {
  54. --bs-btn-color: var(--grw-sidebar-nav-btn-color, var(--grw-primary-300));
  55. --bs-btn-hover-bg: var(--grw-sidebar-nav-btn-hover-bg, var(--grw-highlight-700));
  56. }
  57. }
  58. }