message-part.css 17 KB

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