11/* Overwrite original claude thinking block content styles */
2- .code-block__code {
2+ div [ data-is-streaming ] pre : first-child .code-block__code {
33 background : none !important ;
44 white-space : pre-wrap !important ;
55 word-wrap : break-word !important ;
2020/* collapsed states */
2121
2222/* Collapsed state */
23- .code-block__code .collapsed {
23+ div [ data-is-streaming ] pre : first-child .code-block__code .collapsed {
2424 height : 0 !important ;
2525 padding : 0 !important ;
2626 visibility : hidden !important ;
2727 opacity : 0 !important ;
2828}
2929
3030/* Collapsed state */
31- [data-thinking-block-state = "collapsed" ] .code-block__code {
31+ [data-thinking-block-state = "collapsed" ]
32+ div [data-is-streaming ]
33+ pre : first-child
34+ .code-block__code {
3235 height : 0 !important ;
3336 padding : 0 !important ;
3437 visibility : hidden !important ;
3538 opacity : 0 !important ;
3639}
3740
3841/* Expanded state */
39- /* [data-thinking-block-state="expanded"] .code-block__code {
42+ /* [data-thinking-block-state="expanded"] div[data-is-streaming] pre:first-child .code-block__code {
4043 height: 50vh !important;
4144 padding: 1em !important;
4245 visibility: visible !important;
4346 opacity: 1 !important;
4447} */
4548
46- code {
49+ div [ data-is-streaming ] pre : first-child code {
4750 background : none !important ;
4851 white-space : pre-wrap !important ;
4952 word-wrap : break-word !important ;
@@ -74,13 +77,13 @@ code span:hover {
7477/* --------------------------------- */
7578
7679/* Copy button container */
77- div [data-is-streaming ] .pointer-events-none .sticky {
80+ div [data-is-streaming ] pre : first-child .pointer-events-none .sticky {
7881 cursor : pointer !important ;
7982 pointer-events : auto !important ;
8083}
8184
8285/* Copy button container */
83- div [data-is-streaming ] .from-bg-300\\ / 90 {
86+ div [data-is-streaming ] pre : first-child .from-bg-300\\ / 90 {
8487 pointer-events : auto !important ;
8588 user-select : none !important ;
8689}
@@ -89,7 +92,9 @@ div[data-is-streaming] .from-bg-300\\/90 {
8992
9093/* Update the header text */
9194/* This is the original header text */
92- pre .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty ) {
95+ div [data-is-streaming ]
96+ pre : first-child
97+ .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty ) {
9398 font-size : 0 ; /* Hide original text */
9499 pointer-events : auto !important ; /* Make sure it's clickable */
95100 cursor : pointer !important ;
@@ -99,17 +104,20 @@ pre .text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty) {
99104}
100105
101106/* Update the text of the header */
102- [data-thinking-block-state = "collapsed" ]
103- pre
107+
108+ div [data-thinking-block-state = "collapsed" ]
109+ pre : first-child
104110 .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty )::after {
105- content : "Open Claude's thinking" ;
111+ content : "View Claude's thinking" !important ;
106112 font-size : 0.875rem ; /* Restore font size */
107113 cursor : pointer;
108114 font-family : var (--font-user-message );
109115 transition : color 0.15s ease-in-out;
110116}
111117
112- pre .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty )::after {
118+ div [data-is-streaming ]
119+ pre : first-child
120+ .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty )::after {
113121 content : "Claude's thinking" ;
114122 font-size : 0.875rem ; /* Restore font size */
115123 cursor : pointer;
@@ -118,16 +126,17 @@ pre .text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty)::after {
118126}
119127
120128/* Hover state */
129+ /* This implementation is limited. We can consider to disable this hover state. */
121130[data-thinking-block-state = "expanded" ]
122- pre
131+ pre : first-child
123132 .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty ): hover ::after {
124133 color : hsl (var (--text-100 ));
125134 content : "Hide Claude's thinking" ;
126135}
127136
128137/* Streaming state styles */
129138div [data-is-streaming = "true" ]
130- pre
139+ pre : first-child
131140 .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty )::after {
132141 content : "Claude is thinking..." ;
133142 background : linear-gradient (
@@ -149,7 +158,8 @@ div[data-is-streaming="true"]
149158}
150159
151160/* Chevron-down icon */
152- pre .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty )::before {
161+ pre : first-child
162+ .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty )::before {
153163 content : "" ;
154164 width : 15px ;
155165 height : 15px ;
@@ -182,7 +192,7 @@ pre .text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty)::before {
182192/* Chevron animation */
183193
184194[data-thinking-block-state = "collapsed" ]
185- pre
195+ pre : first-child
186196 .text-text-300 .absolute .pl-3 .pt-2\. 5.text-xs : not (: empty )::before {
187197 transform : rotate (180deg );
188198}
0 commit comments