message-part.css 16 KB

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