message-part.css 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  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. }
  213. [data-component="write-content"] {
  214. border-top: 1px solid var(--border-weaker-base);
  215. max-height: 240px;
  216. overflow-y: auto;
  217. [data-component="code"] {
  218. padding-bottom: 0px !important;
  219. }
  220. /* Hide scrollbar */
  221. scrollbar-width: none;
  222. -ms-overflow-style: none;
  223. &::-webkit-scrollbar {
  224. display: none;
  225. }
  226. }
  227. [data-component="tool-action"] {
  228. width: 24px;
  229. height: 24px;
  230. display: flex;
  231. align-items: center;
  232. justify-content: center;
  233. }
  234. [data-component="todos"] {
  235. padding: 10px 12px 24px 48px;
  236. display: flex;
  237. flex-direction: column;
  238. gap: 8px;
  239. [data-slot="message-part-todo-content"] {
  240. &[data-completed="completed"] {
  241. text-decoration: line-through;
  242. color: var(--text-weaker);
  243. }
  244. }
  245. }
  246. [data-component="task-tools"] {
  247. padding: 8px 12px;
  248. display: flex;
  249. flex-direction: column;
  250. gap: 6px;
  251. [data-slot="task-tool-item"] {
  252. display: flex;
  253. align-items: center;
  254. gap: 8px;
  255. color: var(--text-weak);
  256. [data-slot="icon-svg"] {
  257. flex-shrink: 0;
  258. color: var(--icon-weak);
  259. }
  260. }
  261. [data-slot="task-tool-title"] {
  262. font-family: var(--font-family-sans);
  263. font-size: var(--font-size-small);
  264. font-weight: var(--font-weight-medium);
  265. line-height: var(--line-height-large);
  266. color: var(--text-weak);
  267. }
  268. [data-slot="task-tool-subtitle"] {
  269. font-family: var(--font-family-sans);
  270. font-size: var(--font-size-small);
  271. font-weight: var(--font-weight-regular);
  272. line-height: var(--line-height-large);
  273. color: var(--text-weaker);
  274. overflow: hidden;
  275. text-overflow: ellipsis;
  276. white-space: nowrap;
  277. }
  278. }
  279. [data-component="diagnostics"] {
  280. display: flex;
  281. flex-direction: column;
  282. gap: 4px;
  283. padding: 8px 12px;
  284. background-color: var(--surface-critical-weak);
  285. border-top: 1px solid var(--border-critical-base);
  286. [data-slot="diagnostic"] {
  287. display: flex;
  288. align-items: baseline;
  289. gap: 6px;
  290. font-family: var(--font-family-mono);
  291. font-size: var(--font-size-small);
  292. line-height: var(--line-height-large);
  293. }
  294. [data-slot="diagnostic-label"] {
  295. color: var(--text-on-critical-base);
  296. font-weight: var(--font-weight-medium);
  297. text-transform: uppercase;
  298. letter-spacing: -0.5px;
  299. flex-shrink: 0;
  300. }
  301. [data-slot="diagnostic-location"] {
  302. color: var(--text-on-critical-weak);
  303. flex-shrink: 0;
  304. }
  305. [data-slot="diagnostic-message"] {
  306. color: var(--text-on-critical-base);
  307. word-break: break-word;
  308. display: -webkit-box;
  309. -webkit-box-orient: vertical;
  310. -webkit-line-clamp: 3;
  311. line-clamp: 3;
  312. overflow: hidden;
  313. }
  314. }
  315. [data-component="tool-part-wrapper"] {
  316. width: 100%;
  317. &[data-permission="true"] {
  318. position: sticky;
  319. top: var(--sticky-header-height, 80px);
  320. bottom: 0px;
  321. z-index: 10;
  322. border-radius: 6px;
  323. border: none;
  324. box-shadow: var(--shadow-xs-border-base);
  325. background-color: var(--surface-raised-base);
  326. overflow: visible;
  327. &::before {
  328. content: "";
  329. position: absolute;
  330. inset: -1.5px;
  331. border-radius: 7.5px;
  332. border: 1.5px solid transparent;
  333. background:
  334. linear-gradient(var(--background-base) 0 0) padding-box,
  335. conic-gradient(
  336. from var(--border-angle),
  337. transparent 0deg,
  338. transparent 0deg,
  339. var(--border-warning-strong, var(--border-warning-selected)) 300deg,
  340. var(--border-warning-base) 360deg
  341. )
  342. border-box;
  343. animation: chase-border 2.5s linear infinite;
  344. pointer-events: none;
  345. z-index: -1;
  346. }
  347. & > *:first-child {
  348. border-top-left-radius: 6px;
  349. border-top-right-radius: 6px;
  350. overflow: hidden;
  351. }
  352. & > *:last-child {
  353. border-bottom-left-radius: 6px;
  354. border-bottom-right-radius: 6px;
  355. overflow: hidden;
  356. }
  357. [data-component="collapsible"] {
  358. border: none;
  359. }
  360. [data-component="card"] {
  361. border: none;
  362. }
  363. }
  364. }
  365. @property --border-angle {
  366. syntax: "<angle>";
  367. initial-value: 0deg;
  368. inherits: false;
  369. }
  370. @keyframes chase-border {
  371. from {
  372. --border-angle: 0deg;
  373. }
  374. to {
  375. --border-angle: 360deg;
  376. }
  377. }
  378. [data-component="permission-prompt"] {
  379. display: flex;
  380. flex-direction: column;
  381. padding: 8px 12px;
  382. background-color: var(--surface-raised-strong);
  383. border-radius: 0 0 6px 6px;
  384. [data-slot="permission-message"] {
  385. display: none;
  386. font-family: var(--font-family-sans);
  387. font-size: var(--font-size-small);
  388. font-weight: var(--font-weight-medium);
  389. line-height: var(--line-height-large);
  390. }
  391. [data-slot="permission-actions"] {
  392. display: flex;
  393. align-items: center;
  394. gap: 8px;
  395. justify-content: flex-end;
  396. }
  397. }