MessageCard.module.scss 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. @use '@growi/core-styles/scss/bootstrap/init' as bs;
  2. @use '@growi/core-styles/scss/variables/growi-official-colors';
  3. // remove margin from last child
  4. .message-card :global {
  5. .card-body {
  6. p:last-child {
  7. margin-bottom: 0;
  8. }
  9. }
  10. }
  11. /*************************
  12. * AssistantMessageCard
  13. ************************/
  14. .assistant-message-card :global {
  15. .card-body {
  16. --bs-card-spacer-x: 0;
  17. --bs-card-spacer-y: 0.8rem;
  18. }
  19. }
  20. .assistant-message-card :global {
  21. .grw-ai-icon {
  22. padding: 0.4em;
  23. }
  24. }
  25. // text animation
  26. // refs: https://web.dev/articles/speedy-css-tip-animated-gradient-text?hl=ja
  27. .assistant-message-card :global {
  28. .text-thinking {
  29. --bg-size: 400%;
  30. --color-one: var(--bs-tertiary-color);
  31. --color-two: var(--grw-highlight-300);
  32. color: transparent;
  33. background: linear-gradient(
  34. -90deg,
  35. var(--color-one),
  36. var(--color-two),
  37. var(--color-one)
  38. ) 0 0 / var(--bg-size) 100%;
  39. -webkit-background-clip: text;
  40. background-clip: text;
  41. }
  42. @media (prefers-reduced-motion: no-preference) {
  43. .text-thinking {
  44. &:local {
  45. animation: move-bg 6s linear infinite;
  46. }
  47. }
  48. @keyframes move-bg {
  49. from {
  50. background-position: var(--bg-size) 0;
  51. }
  52. }
  53. }
  54. }
  55. /*******************
  56. * UserMessageCard
  57. *******************/
  58. .user-message-card :global {
  59. .card-body {
  60. --bs-card-spacer-x: 1.25rem;
  61. --bs-card-spacer-y: 0.8rem;
  62. }
  63. }
  64. // baloon style
  65. .user-message-card :global {
  66. border: 0;
  67. --bs-card-border-radius: var(--bs-border-radius-xxl);
  68. border-bottom-right-radius: var(--bs-border-radius-lg);
  69. }
  70. // max width
  71. .user-message-card :global {
  72. max-width: 85%;
  73. @include bs.media-breakpoint-up(lg) {
  74. max-width: 75%;
  75. }
  76. }
  77. // == Colors
  78. .assistant-message-card :global {
  79. .grw-ai-icon {
  80. color: white;
  81. background-color: growi-official-colors.$growi-ai-purple;
  82. }
  83. }