message-part.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  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-weak-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. position: relative;
  66. white-space: pre-wrap;
  67. word-break: break-word;
  68. overflow: hidden;
  69. background: var(--surface-base);
  70. padding: 8px 12px;
  71. border-radius: 4px;
  72. [data-slot="user-message-copy-wrapper"] {
  73. position: absolute;
  74. top: 7px;
  75. right: 7px;
  76. opacity: 0;
  77. transition: opacity 0.15s ease;
  78. }
  79. &:hover [data-slot="user-message-copy-wrapper"] {
  80. opacity: 1;
  81. }
  82. }
  83. .text-text-strong {
  84. color: var(--text-strong);
  85. }
  86. .font-medium {
  87. font-weight: var(--font-weight-medium);
  88. }
  89. }
  90. [data-component="text-part"] {
  91. width: 100%;
  92. [data-component="markdown"] {
  93. margin-top: 32px;
  94. font-size: var(--font-size-base);
  95. }
  96. }
  97. [data-component="reasoning-part"] {
  98. width: 100%;
  99. opacity: 0.5;
  100. [data-component="markdown"] {
  101. margin-top: 24px;
  102. font-style: italic !important;
  103. }
  104. }
  105. [data-component="tool-error"] {
  106. display: flex;
  107. align-items: start;
  108. gap: 8px;
  109. [data-slot="icon-svg"] {
  110. color: var(--icon-critical-base);
  111. margin-top: 4px;
  112. }
  113. [data-slot="message-part-tool-error-content"] {
  114. display: flex;
  115. align-items: start;
  116. gap: 8px;
  117. }
  118. [data-slot="message-part-tool-error-title"] {
  119. font-family: var(--font-family-sans);
  120. font-size: var(--font-size-base);
  121. font-style: normal;
  122. font-weight: var(--font-weight-medium);
  123. line-height: var(--line-height-large);
  124. letter-spacing: var(--letter-spacing-normal);
  125. color: var(--text-on-critical-base);
  126. white-space: nowrap;
  127. }
  128. [data-slot="message-part-tool-error-message"] {
  129. color: var(--text-on-critical-weak);
  130. max-height: 240px;
  131. overflow-y: auto;
  132. word-break: break-word;
  133. }
  134. }
  135. [data-component="tool-output"] {
  136. white-space: pre;
  137. padding: 8px 12px;
  138. height: fit-content;
  139. display: flex;
  140. flex-direction: column;
  141. align-items: flex-start;
  142. justify-content: flex-start;
  143. [data-component="markdown"] {
  144. width: 100%;
  145. min-width: 0;
  146. pre {
  147. margin: 0;
  148. padding: 0;
  149. background-color: transparent !important;
  150. border: none !important;
  151. }
  152. }
  153. pre {
  154. margin: 0;
  155. padding: 0;
  156. background: none;
  157. }
  158. &[data-scrollable] {
  159. height: auto;
  160. max-height: 240px;
  161. overflow-y: auto;
  162. scrollbar-width: none;
  163. -ms-overflow-style: none;
  164. &::-webkit-scrollbar {
  165. display: none;
  166. }
  167. [data-component="markdown"] {
  168. overflow: visible;
  169. }
  170. }
  171. }
  172. [data-component="edit-trigger"],
  173. [data-component="write-trigger"] {
  174. display: flex;
  175. align-items: center;
  176. justify-content: space-between;
  177. gap: 8px;
  178. width: 100%;
  179. [data-slot="message-part-title-area"] {
  180. flex-grow: 1;
  181. display: flex;
  182. align-items: center;
  183. gap: 8px;
  184. min-width: 0;
  185. }
  186. [data-slot="message-part-title"] {
  187. flex-shrink: 0;
  188. font-family: var(--font-family-sans);
  189. font-size: var(--font-size-base);
  190. font-style: normal;
  191. font-weight: var(--font-weight-medium);
  192. line-height: var(--line-height-large);
  193. letter-spacing: var(--letter-spacing-normal);
  194. color: var(--text-base);
  195. text-transform: capitalize;
  196. }
  197. [data-slot="message-part-path"] {
  198. display: flex;
  199. flex-grow: 1;
  200. min-width: 0;
  201. }
  202. [data-slot="message-part-directory"] {
  203. color: var(--text-weak);
  204. text-overflow: ellipsis;
  205. overflow: hidden;
  206. white-space: nowrap;
  207. direction: rtl;
  208. text-align: left;
  209. }
  210. [data-slot="message-part-filename"] {
  211. color: var(--text-strong);
  212. flex-shrink: 0;
  213. }
  214. [data-slot="message-part-actions"] {
  215. display: flex;
  216. gap: 16px;
  217. align-items: center;
  218. justify-content: flex-end;
  219. }
  220. }
  221. [data-component="edit-content"] {
  222. border-top: 1px solid var(--border-weaker-base);
  223. max-height: 420px;
  224. overflow-y: auto;
  225. scrollbar-width: none;
  226. -ms-overflow-style: none;
  227. &::-webkit-scrollbar {
  228. display: none;
  229. }
  230. }
  231. [data-component="write-content"] {
  232. border-top: 1px solid var(--border-weaker-base);
  233. max-height: 240px;
  234. overflow-y: auto;
  235. [data-component="code"] {
  236. padding-bottom: 0px !important;
  237. }
  238. /* Hide scrollbar */
  239. scrollbar-width: none;
  240. -ms-overflow-style: none;
  241. &::-webkit-scrollbar {
  242. display: none;
  243. }
  244. }
  245. [data-component="tool-action"] {
  246. width: 24px;
  247. height: 24px;
  248. display: flex;
  249. align-items: center;
  250. justify-content: center;
  251. }
  252. [data-component="todos"] {
  253. padding: 10px 12px 24px 48px;
  254. display: flex;
  255. flex-direction: column;
  256. gap: 8px;
  257. [data-slot="message-part-todo-content"] {
  258. &[data-completed="completed"] {
  259. text-decoration: line-through;
  260. color: var(--text-weaker);
  261. }
  262. }
  263. }
  264. [data-component="task-tools"] {
  265. padding: 8px 12px;
  266. display: flex;
  267. flex-direction: column;
  268. gap: 6px;
  269. [data-slot="task-tool-item"] {
  270. display: flex;
  271. align-items: center;
  272. gap: 8px;
  273. color: var(--text-weak);
  274. [data-slot="icon-svg"] {
  275. flex-shrink: 0;
  276. color: var(--icon-weak);
  277. }
  278. }
  279. [data-slot="task-tool-title"] {
  280. font-family: var(--font-family-sans);
  281. font-size: var(--font-size-small);
  282. font-weight: var(--font-weight-medium);
  283. line-height: var(--line-height-large);
  284. color: var(--text-weak);
  285. }
  286. [data-slot="task-tool-subtitle"] {
  287. font-family: var(--font-family-sans);
  288. font-size: var(--font-size-small);
  289. font-weight: var(--font-weight-regular);
  290. line-height: var(--line-height-large);
  291. color: var(--text-weaker);
  292. overflow: hidden;
  293. text-overflow: ellipsis;
  294. white-space: nowrap;
  295. }
  296. }
  297. [data-component="diagnostics"] {
  298. display: flex;
  299. flex-direction: column;
  300. gap: 4px;
  301. padding: 8px 12px;
  302. background-color: var(--surface-critical-weak);
  303. border-top: 1px solid var(--border-critical-base);
  304. [data-slot="diagnostic"] {
  305. display: flex;
  306. align-items: baseline;
  307. gap: 6px;
  308. font-family: var(--font-family-mono);
  309. font-size: var(--font-size-small);
  310. line-height: var(--line-height-large);
  311. }
  312. [data-slot="diagnostic-label"] {
  313. color: var(--text-on-critical-base);
  314. font-weight: var(--font-weight-medium);
  315. text-transform: uppercase;
  316. letter-spacing: -0.5px;
  317. flex-shrink: 0;
  318. }
  319. [data-slot="diagnostic-location"] {
  320. color: var(--text-on-critical-weak);
  321. flex-shrink: 0;
  322. }
  323. [data-slot="diagnostic-message"] {
  324. color: var(--text-on-critical-base);
  325. word-break: break-word;
  326. display: -webkit-box;
  327. -webkit-box-orient: vertical;
  328. -webkit-line-clamp: 3;
  329. line-clamp: 3;
  330. overflow: hidden;
  331. }
  332. }
  333. [data-component="user-message"] [data-slot="user-message-text"],
  334. [data-component="text-part"],
  335. [data-component="reasoning-part"],
  336. [data-component="tool-error"],
  337. [data-component="tool-output"],
  338. [data-component="edit-content"],
  339. [data-component="write-content"],
  340. [data-component="todos"],
  341. [data-component="diagnostics"],
  342. .error-card {
  343. -webkit-user-select: text;
  344. user-select: text;
  345. }
  346. [data-component="tool-part-wrapper"] {
  347. width: 100%;
  348. &[data-permission="true"],
  349. &[data-question="true"] {
  350. position: sticky;
  351. top: calc(2px + var(--sticky-header-height, 40px));
  352. bottom: 0px;
  353. z-index: 20;
  354. border-radius: 6px;
  355. border: none;
  356. box-shadow: var(--shadow-xs-border-base);
  357. background-color: var(--surface-raised-base);
  358. overflow: visible;
  359. overflow-anchor: none;
  360. & > *:first-child {
  361. border-top-left-radius: 6px;
  362. border-top-right-radius: 6px;
  363. overflow: hidden;
  364. }
  365. & > *:last-child {
  366. border-bottom-left-radius: 6px;
  367. border-bottom-right-radius: 6px;
  368. overflow: hidden;
  369. }
  370. [data-component="collapsible"] {
  371. border: none;
  372. }
  373. [data-component="card"] {
  374. border: none;
  375. }
  376. }
  377. &[data-permission="true"] {
  378. &::before {
  379. content: "";
  380. position: absolute;
  381. inset: -1.5px;
  382. top: -5px;
  383. border-radius: 7.5px;
  384. border: 1.5px solid transparent;
  385. background:
  386. linear-gradient(var(--background-base) 0 0) padding-box,
  387. conic-gradient(
  388. from var(--border-angle),
  389. transparent 0deg,
  390. transparent 0deg,
  391. var(--border-warning-strong, var(--border-warning-selected)) 300deg,
  392. var(--border-warning-base) 360deg
  393. )
  394. border-box;
  395. animation: chase-border 2.5s linear infinite;
  396. pointer-events: none;
  397. z-index: -1;
  398. }
  399. }
  400. &[data-question="true"] {
  401. background: var(--background-base);
  402. border: 1px solid var(--border-weak-base);
  403. }
  404. }
  405. @property --border-angle {
  406. syntax: "<angle>";
  407. initial-value: 0deg;
  408. inherits: false;
  409. }
  410. @keyframes chase-border {
  411. from {
  412. --border-angle: 0deg;
  413. }
  414. to {
  415. --border-angle: 360deg;
  416. }
  417. }
  418. [data-component="permission-prompt"] {
  419. display: flex;
  420. flex-direction: column;
  421. padding: 8px 12px;
  422. background-color: var(--surface-raised-strong);
  423. border-radius: 0 0 6px 6px;
  424. [data-slot="permission-actions"] {
  425. display: flex;
  426. align-items: center;
  427. gap: 8px;
  428. justify-content: flex-end;
  429. }
  430. }
  431. [data-component="question-prompt"] {
  432. display: flex;
  433. flex-direction: column;
  434. padding: 12px;
  435. background-color: var(--surface-inset-base);
  436. border-radius: 0 0 6px 6px;
  437. gap: 12px;
  438. [data-slot="question-tabs"] {
  439. display: flex;
  440. gap: 4px;
  441. flex-wrap: wrap;
  442. [data-slot="question-tab"] {
  443. padding: 4px 12px;
  444. font-size: 13px;
  445. border-radius: 4px;
  446. background-color: var(--surface-base);
  447. color: var(--text-base);
  448. border: none;
  449. cursor: pointer;
  450. transition:
  451. color 0.15s,
  452. background-color 0.15s;
  453. &:hover {
  454. background-color: var(--surface-base-hover);
  455. }
  456. &[data-active="true"] {
  457. background-color: var(--surface-raised-base);
  458. }
  459. &[data-answered="true"] {
  460. color: var(--text-strong);
  461. }
  462. }
  463. }
  464. [data-slot="question-content"] {
  465. display: flex;
  466. flex-direction: column;
  467. gap: 8px;
  468. [data-slot="question-text"] {
  469. font-size: 14px;
  470. color: var(--text-base);
  471. line-height: 1.5;
  472. }
  473. }
  474. [data-slot="question-options"] {
  475. display: flex;
  476. flex-direction: column;
  477. gap: 4px;
  478. [data-slot="question-option"] {
  479. display: flex;
  480. flex-direction: column;
  481. align-items: flex-start;
  482. gap: 2px;
  483. padding: 8px 12px;
  484. background-color: var(--surface-base);
  485. border: 1px solid var(--border-weaker-base);
  486. border-radius: 6px;
  487. cursor: pointer;
  488. text-align: left;
  489. width: 100%;
  490. transition:
  491. background-color 0.15s,
  492. border-color 0.15s;
  493. position: relative;
  494. &:hover {
  495. background-color: var(--surface-base-hover);
  496. border-color: var(--border-default);
  497. }
  498. &[data-picked="true"] {
  499. [data-component="icon"] {
  500. position: absolute;
  501. right: 12px;
  502. top: 50%;
  503. transform: translateY(-50%);
  504. color: var(--text-strong);
  505. }
  506. }
  507. [data-slot="option-label"] {
  508. font-size: 14px;
  509. color: var(--text-base);
  510. font-weight: 500;
  511. }
  512. [data-slot="option-description"] {
  513. font-size: 12px;
  514. color: var(--text-weak);
  515. }
  516. }
  517. [data-slot="custom-input-form"] {
  518. display: flex;
  519. gap: 8px;
  520. padding: 8px 0;
  521. align-items: stretch;
  522. [data-slot="custom-input"] {
  523. flex: 1;
  524. padding: 8px 12px;
  525. font-size: 14px;
  526. border: 1px solid var(--border-default);
  527. border-radius: 6px;
  528. background-color: var(--surface-base);
  529. color: var(--text-base);
  530. outline: none;
  531. &:focus {
  532. border-color: var(--border-focus);
  533. }
  534. &::placeholder {
  535. color: var(--text-weak);
  536. }
  537. }
  538. [data-component="button"] {
  539. height: auto;
  540. }
  541. }
  542. }
  543. [data-slot="question-review"] {
  544. display: flex;
  545. flex-direction: column;
  546. gap: 12px;
  547. [data-slot="review-title"] {
  548. display: none;
  549. }
  550. [data-slot="review-item"] {
  551. display: flex;
  552. flex-direction: column;
  553. gap: 2px;
  554. font-size: 13px;
  555. [data-slot="review-label"] {
  556. color: var(--text-weak);
  557. }
  558. [data-slot="review-value"] {
  559. color: var(--text-strong);
  560. &[data-answered="false"] {
  561. color: var(--text-weak);
  562. }
  563. }
  564. }
  565. }
  566. [data-slot="question-actions"] {
  567. display: flex;
  568. align-items: center;
  569. gap: 8px;
  570. justify-content: flex-end;
  571. }
  572. }
  573. [data-component="question-answers"] {
  574. display: flex;
  575. flex-direction: column;
  576. gap: 12px;
  577. padding: 8px 12px;
  578. [data-slot="question-answer-item"] {
  579. display: flex;
  580. flex-direction: column;
  581. gap: 2px;
  582. font-size: 13px;
  583. [data-slot="question-text"] {
  584. color: var(--text-weak);
  585. }
  586. [data-slot="answer-text"] {
  587. color: var(--text-strong);
  588. }
  589. }
  590. }