AppTitle.module.scss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. @use '@growi/core/scss/bootstrap/init' as bs;
  2. @use '@growi/core/scss/growi-official-colors';
  3. @use '~/styles/variables' as var;
  4. @use '../button-styles';
  5. // GROWI Logo
  6. .grw-app-title :global {
  7. .grw-logo {
  8. $width: var.$grw-sidebar-nav-width;
  9. $height: var.$grw-sidebar-nav-width; // declare $height with the same value as the sidebar nav width
  10. $logomark-width: 27.7px;
  11. $logomark-height: 24px;
  12. width: $width;
  13. svg {
  14. width: $width;
  15. height: $height;
  16. padding: (($height - $logomark-height) / 2) (($width - $logomark-width) / 2);
  17. }
  18. }
  19. }
  20. // == Location
  21. .on-subnavigation {
  22. top: 0;
  23. @include bs.media-breakpoint-up(md) {
  24. left: var.$grw-sidebar-nav-width;
  25. }
  26. }
  27. // == App title truncation
  28. .on-subnavigation {
  29. // set width for truncation
  30. $grw-page-controls-width: 226px;
  31. $grw-page-editor-mode-manager-width: 90px;
  32. $grw-contextual-subnavigation-padding-right: 8px;
  33. $gap: 8px;
  34. width: calc(100vw - #{$grw-page-controls-width + $grw-page-editor-mode-manager-width + $grw-contextual-subnavigation-padding-right + $gap * 2});
  35. @include bs.media-breakpoint-up(md) {
  36. $grw-page-editor-mode-manager-width: 140px;
  37. $gap: 24px;
  38. width: calc(100vw - #{var.$grw-sidebar-nav-width + $grw-page-controls-width + $grw-page-editor-mode-manager-width + $grw-contextual-subnavigation-padding-right + $gap * 2});
  39. }
  40. }
  41. .on-sidebar-head {
  42. $toggle-collapse-button-width: 50px;
  43. // set width for truncation
  44. width: calc(100% - $toggle-collapse-button-width);
  45. }
  46. // == Interaction
  47. @keyframes bounce-to-right {
  48. 10% { transform:translateX(3px); }
  49. 20% { transform:translateX(0%); }
  50. 25% { transform:translateX(2px); }
  51. 27% { transform:translateX(0%); }
  52. }
  53. .on-subnavigation {
  54. animation: bounce-to-right 1s ease;
  55. }
  56. @keyframes bounce-to-left {
  57. 0% { transform:translateX(48px); }
  58. 100% { transform:translateX(0%); }
  59. }
  60. .on-sidebar-head {
  61. animation: bounce-to-left 0.2s ease;
  62. }
  63. // == Colors
  64. .grw-app-title :global {
  65. .grw-logo {
  66. // set transition for fill
  67. svg, svg * {
  68. transition: fill 0.8s ease-out;
  69. }
  70. fill: var(--grw-app-title-color, var(--bs-tertiary-color));
  71. &:hover {
  72. svg {
  73. .group1 {
  74. fill: growi-official-colors.$growi-green;
  75. }
  76. .group2 {
  77. fill: growi-official-colors.$growi-blue;
  78. }
  79. }
  80. }
  81. }
  82. .grw-site-name {
  83. --bs-link-color-rgb: var(--grw-app-title-color-rgb, var(--bs-tertiary-color-rgb));
  84. --bs-link-opacity: 0.5;
  85. }
  86. }