message-part.css 9.6 KB

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