Skip to content

Commit fb4de9f

Browse files
committed
Refactor UI styles and fix button font size inheritance
- use css for [Pasted text]
1 parent 5b24e88 commit fb4de9f

4 files changed

Lines changed: 9 additions & 20 deletions

File tree

‎packages/ui/src/components/editor/common/prompts/PromptField/PromptField.module.scss‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@
199199

200200
&__details {
201201
display: none;
202-
flex: 1;
203202
align-items: center;
204203
justify-content: flex-end;
205204
min-width: 0;
@@ -217,22 +216,17 @@
217216
min-width: 0;
218217
}
219218

220-
&__token-count {
221-
font-size: inherit;
222-
color: var(--cwc-text-color-dimmed);
223-
white-space: nowrap;
224-
font-variant-numeric: tabular-nums;
225-
pointer-events: auto;
219+
&__token-count-wrapper {
220+
position: relative;
226221
}
227222

228-
&__separator {
229-
font-size: inherit;
223+
&__token-count {
230224
color: var(--cwc-text-color-dimmed);
231-
padding: 0 4px;
225+
font-variant-numeric: tabular-nums;
226+
cursor: default;
232227
}
233228

234229
&__button {
235-
font-size: inherit;
236230
pointer-events: all;
237231
color: var(--vscode-foreground);
238232
padding: 5px 2px;

‎packages/ui/src/components/editor/common/prompts/PromptField/PromptField.tsx‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -573,14 +573,11 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
573573
props.token_count > 0 &&
574574
props.show_edit_format_selector &&
575575
props.edit_format && (
576-
<span className={styles['footer__right__separator']}>·</span>
576+
<span>·</span>
577577
)}
578578
{props.token_count !== undefined && props.token_count > 0 && (
579579
<span
580-
style={{
581-
position: 'relative',
582-
display: 'inline-flex'
583-
}}
580+
className={styles['footer__right__details__token-count-wrapper']}
584581
onMouseEnter={() => set_is_token_count_hovered(true)}
585582
onMouseLeave={() => set_is_token_count_hovered(false)}
586583
>
@@ -590,7 +587,7 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
590587
align="center"
591588
/>
592589
)}
593-
<span className={styles['footer__right__token-count']}>
590+
<span className={styles['footer__right__details__token-count']}>
594591
{props.token_count < 1000
595592
? props.token_count.toString()
596593
: Math.floor(props.token_count / 1000).toString() + 'K'}

‎packages/ui/src/components/editor/prompt/Tabs/Tabs.module.scss‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
font-size: 16px;
2323
padding: 4px 10px 2px 10px;
2424
letter-spacing: 1px;
25-
border: 1px solid transparent;
2625
border-bottom: none;
2726
border-top-left-radius: 8px;
2827
border-top-right-radius: 8px;
@@ -46,7 +45,6 @@
4645
&--active {
4746
color: var(--cwc-text-color-blue);
4847
background-color: var(--cwc-bg-blue);
49-
border-color: var(--vscode-menu-separatorBackground);
5048
position: relative;
5149

5250
&::after {

‎packages/ui/src/styles/global.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ button {
2121
border: none;
2222
background: none;
2323
padding: 0;
24-
font-size: 13px;
24+
font-size: inherit;
2525
font-family: inherit;
2626
color: inherit;
2727
line-height: inherit;

0 commit comments

Comments
 (0)