message-part.css 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. [data-component="assistant-message"] {
  2. content-visibility: auto;
  3. width: 100%;
  4. display: flex;
  5. flex-direction: column;
  6. align-items: flex-start;
  7. gap: 12px;
  8. }
  9. [data-component="user-message"] {
  10. font-family: var(--font-family-sans);
  11. font-size: var(--font-size-base);
  12. font-style: normal;
  13. font-weight: var(--font-weight-regular);
  14. line-height: var(--line-height-large);
  15. letter-spacing: var(--letter-spacing-normal);
  16. color: var(--text-base);
  17. display: flex;
  18. flex-direction: column;
  19. gap: 8px;
  20. [data-slot="user-message-attachments"] {
  21. display: flex;
  22. flex-wrap: wrap;
  23. gap: 8px;
  24. }
  25. [data-slot="user-message-attachment"] {
  26. display: flex;
  27. flex-direction: column;
  28. align-items: center;
  29. justify-content: center;
  30. border-radius: 6px;
  31. overflow: hidden;
  32. background: var(--surface-base);
  33. border: 1px solid var(--border-base);
  34. transition: border-color 0.15s ease;
  35. &:hover {
  36. border-color: var(--border-strong-base);
  37. }
  38. &[data-clickable="true"] {
  39. cursor: pointer;
  40. }
  41. &[data-type="image"] {
  42. width: 48px;
  43. height: 48px;
  44. }
  45. &[data-type="file"] {
  46. width: 48px;
  47. height: 48px;
  48. }
  49. }
  50. [data-slot="user-message-attachment-image"] {
  51. width: 100%;
  52. height: 100%;
  53. object-fit: cover;
  54. }
  55. [data-slot="user-message-attachment-icon"] {
  56. width: 100%;
  57. height: 100%;
  58. display: flex;
  59. align-items: center;
  60. justify-content: center;
  61. color: var(--icon-weak);
  62. [data-component="icon"] {
  63. width: 20px;
  64. height: 20px;
  65. }
  66. }
  67. [data-slot="user-message-text"] {
  68. white-space: pre-wrap;
  69. word-break: break-word;
  70. overflow: hidden;
  71. background: var(--surface-base);
  72. padding: 8px 12px;
  73. border-radius: 4px;
  74. }
  75. .text-text-strong {
  76. color: var(--text-strong);
  77. }
  78. .font-medium {
  79. font-weight: var(--font-weight-medium);
  80. }
  81. }
  82. [data-component="text-part"] {
  83. width: 100%;
  84. [data-component="markdown"] {
  85. margin-top: 32px;
  86. font-size: var(--font-size-base);
  87. }
  88. }
  89. [data-component="reasoning-part"] {
  90. width: 100%;
  91. opacity: 0.5;
  92. [data-component="markdown"] {
  93. margin-top: 24px;
  94. font-style: italic !important;
  95. }
  96. }
  97. [data-component="tool-error"] {
  98. display: flex;
  99. align-items: start;
  100. gap: 8px;
  101. [data-slot="icon-svg"] {
  102. color: var(--icon-critical-base);
  103. margin-top: 4px;
  104. }
  105. [data-slot="message-part-tool-error-content"] {
  106. display: flex;
  107. align-items: start;
  108. gap: 8px;
  109. }
  110. [data-slot="message-part-tool-error-title"] {
  111. font-family: var(--font-family-sans);
  112. font-size: var(--font-size-base);
  113. font-style: normal;
  114. font-weight: var(--font-weight-medium);
  115. line-height: var(--line-height-large);
  116. letter-spacing: var(--letter-spacing-normal);
  117. color: var(--text-on-critical-base);
  118. white-space: nowrap;
  119. }
  120. [data-slot="message-part-tool-error-message"] {
  121. color: var(--text-on-critical-weak);
  122. max-height: 240px;
  123. overflow-y: auto;
  124. word-break: break-word;
  125. }
  126. }
  127. [data-component="tool-output"] {
  128. white-space: pre;
  129. padding: 8px 12px;
  130. height: fit-content;
  131. display: flex;
  132. flex-direction: column;
  133. align-items: flex-start;
  134. justify-content: flex-start;
  135. [data-component="markdown"] {
  136. width: 100%;
  137. min-width: 0;
  138. pre {
  139. margin: 0;
  140. padding: 0;
  141. background-color: transparent !important;
  142. border: none !important;
  143. }
  144. }
  145. pre {
  146. margin: 0;
  147. padding: 0;
  148. background: none;
  149. }
  150. &[data-scrollable] {
  151. height: auto;
  152. max-height: 240px;
  153. overflow-y: auto;
  154. scrollbar-width: none;
  155. -ms-overflow-style: none;
  156. &::-webkit-scrollbar {
  157. display: none;
  158. }
  159. [data-component="markdown"] {
  160. overflow: visible;
  161. }
  162. }
  163. }
  164. [data-component="edit-trigger"],
  165. [data-component="write-trigger"] {
  166. display: flex;
  167. align-items: center;
  168. justify-content: space-between;
  169. gap: 8px;
  170. width: 100%;
  171. [data-slot="message-part-title-area"] {
  172. flex-grow: 1;
  173. display: flex;
  174. align-items: center;
  175. gap: 8px;
  176. min-width: 0;
  177. }
  178. [data-slot="message-part-title"] {
  179. flex-shrink: 0;
  180. font-family: var(--font-family-sans);
  181. font-size: var(--font-size-base);
  182. font-style: normal;
  183. font-weight: var(--font-weight-medium);
  184. line-height: var(--line-height-large);
  185. letter-spacing: var(--letter-spacing-normal);
  186. color: var(--text-base);
  187. text-transform: capitalize;
  188. }
  189. [data-slot="message-part-path"] {
  190. display: flex;
  191. flex-grow: 1;
  192. min-width: 0;
  193. }
  194. [data-slot="message-part-directory"] {
  195. color: var(--text-weak);
  196. text-overflow: ellipsis;
  197. overflow: hidden;
  198. white-space: nowrap;
  199. direction: rtl;
  200. text-align: left;
  201. }
  202. [data-slot="message-part-filename"] {
  203. color: var(--text-strong);
  204. flex-shrink: 0;
  205. }
  206. [data-slot="message-part-actions"] {
  207. display: flex;
  208. gap: 16px;
  209. align-items: center;
  210. justify-content: flex-end;
  211. }
  212. }
  213. [data-component="edit-content"] {
  214. border-top: 1px solid var(--border-weaker-base);
  215. max-height: 420px;
  216. overflow-y: auto;
  217. scrollbar-width: none;
  218. -ms-overflow-style: none;
  219. &::-webkit-scrollbar {
  220. display: none;
  221. }
  222. }
  223. [data-component="write-content"] {
  224. border-top: 1px solid var(--border-weaker-base);
  225. max-height: 240px;
  226. overflow-y: auto;
  227. [data-component="code"] {
  228. padding-bottom: 0px !important;
  229. }
  230. /* Hide scrollbar */
  231. scrollbar-width: none;
  232. -ms-overflow-style: none;
  233. &::-webkit-scrollbar {
  234. display: none;
  235. }
  236. }
  237. [data-component="tool-action"] {
  238. width: 24px;
  239. height: 24px;
  240. display: flex;
  241. align-items: center;
  242. justify-content: center;
  243. }
  244. [data-component="todos"] {
  245. padding: 10px 12px 24px 48px;
  246. display: flex;
  247. flex-direction: column;
  248. gap: 8px;
  249. [data-slot="message-part-todo-content"] {
  250. &[data-completed="completed"] {
  251. text-decoration: line-through;
  252. color: var(--text-weaker);
  253. }
  254. }
  255. }
  256. [data-component="task-tools"] {
  257. padding: 8px 12px;
  258. display: flex;
  259. flex-direction: column;
  260. gap: 6px;
  261. [data-slot="task-tool-item"] {
  262. display: flex;
  263. align-items: center;
  264. gap: 8px;
  265. color: var(--text-weak);
  266. [data-slot="icon-svg"] {
  267. flex-shrink: 0;
  268. color: var(--icon-weak);
  269. }
  270. }
  271. [data-slot="task-tool-title"] {
  272. font-family: var(--font-family-sans);
  273. font-size: var(--font-size-small);
  274. font-weight: var(--font-weight-medium);
  275. line-height: var(--line-height-large);
  276. color: var(--text-weak);
  277. }
  278. [data-slot="task-tool-subtitle"] {
  279. font-family: var(--font-family-sans);
  280. font-size: var(--font-size-small);
  281. font-weight: var(--font-weight-regular);
  282. line-height: var(--line-height-large);
  283. color: var(--text-weaker);
  284. overflow: hidden;
  285. text-overflow: ellipsis;
  286. white-space: nowrap;
  287. }
  288. }
  289. [data-component="diagnostics"] {
  290. display: flex;
  291. flex-direction: column;
  292. gap: 4px;
  293. padding: 8px 12px;
  294. background-color: var(--surface-critical-weak);
  295. border-top: 1px solid var(--border-critical-base);
  296. [data-slot="diagnostic"] {
  297. display: flex;
  298. align-items: baseline;
  299. gap: 6px;
  300. font-family: var(--font-family-mono);
  301. font-size: var(--font-size-small);
  302. line-height: var(--line-height-large);
  303. }
  304. [data-slot="diagnostic-label"] {
  305. color: var(--text-on-critical-base);
  306. font-weight: var(--font-weight-medium);
  307. text-transform: uppercase;
  308. letter-spacing: -0.5px;
  309. flex-shrink: 0;
  310. }
  311. [data-slot="diagnostic-location"] {
  312. color: var(--text-on-critical-weak);
  313. flex-shrink: 0;
  314. }
  315. [data-slot="diagnostic-message"] {
  316. color: var(--text-on-critical-base);
  317. word-break: break-word;
  318. display: -webkit-box;
  319. -webkit-box-orient: vertical;
  320. -webkit-line-clamp: 3;
  321. line-clamp: 3;
  322. overflow: hidden;
  323. }
  324. }
  325. [data-component="user-message"] [data-slot="user-message-text"],
  326. [data-component="text-part"],
  327. [data-component="reasoning-part"],
  328. [data-component="tool-error"],
  329. [data-component="tool-output"],
  330. [data-component="edit-content"],
  331. [data-component="write-content"],
  332. [data-component="todos"],
  333. [data-component="diagnostics"] {
  334. -webkit-user-select: text;
  335. user-select: text;
  336. }
  337. [data-component="tool-part-wrapper"] {
  338. width: 100%;
  339. &[data-permission="true"] {
  340. position: sticky;
  341. top: calc(2px + var(--sticky-header-height, 40px));
  342. bottom: 0px;
  343. z-index: 20;
  344. border-radius: 6px;
  345. border: none;
  346. box-shadow: var(--shadow-xs-border-base);
  347. background-color: var(--surface-raised-base);
  348. overflow: visible;
  349. &::before {
  350. content: "";
  351. position: absolute;
  352. inset: -1.5px;
  353. top: -5px;
  354. border-radius: 7.5px;
  355. border: 1.5px solid transparent;
  356. background:
  357. linear-gradient(var(--background-base) 0 0) padding-box,
  358. conic-gradient(from var(--border-angle),
  359. transparent 0deg,
  360. transparent 0deg,
  361. var(--border-warning-strong, var(--border-warning-selected)) 300deg,
  362. var(--border-warning-base) 360deg) border-box;
  363. animation: chase-border 2.5s linear infinite;
  364. pointer-events: none;
  365. z-index: -1;
  366. }
  367. &>*:first-child {
  368. border-top-left-radius: 6px;
  369. border-top-right-radius: 6px;
  370. overflow: hidden;
  371. }
  372. &>*:last-child {
  373. border-bottom-left-radius: 6px;
  374. border-bottom-right-radius: 6px;
  375. overflow: hidden;
  376. }
  377. [data-component="collapsible"] {
  378. border: none;
  379. }
  380. [data-component="card"] {
  381. border: none;
  382. }
  383. }
  384. }
  385. @property --border-angle {
  386. syntax: "<angle>";
  387. initial-value: 0deg;
  388. inherits: false;
  389. }
  390. @keyframes chase-border {
  391. from {
  392. --border-angle: 0deg;
  393. }
  394. to {
  395. --border-angle: 360deg;
  396. }
  397. }
  398. [data-component="permission-prompt"] {
  399. display: flex;
  400. flex-direction: column;
  401. padding: 8px 12px;
  402. background-color: var(--surface-raised-strong);
  403. border-radius: 0 0 6px 6px;
  404. [data-slot="permission-actions"] {
  405. display: flex;
  406. align-items: center;
  407. gap: 8px;
  408. justify-content: flex-end;
  409. }
  410. }