message-part.css 10.0 KB

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