Skip to content

Commit 39ee36c

Browse files
committed
Refine UI styling for toggler, settings lists, and section components with consistent spacing and visual updates
1 parent 3392108 commit 39ee36c

8 files changed

Lines changed: 36 additions & 26 deletions

File tree

‎packages/ui/src/components/editor/common/Toggler/Toggler.module.scss‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
right: 0;
2020
bottom: 0;
2121
background-color: var(--cwc-bg-primary);
22-
border: 1px solid var(--cwc-border-color);
2322
transition: var(--transition-duration-250);
24-
border-radius: 20px;
23+
border-radius: 10px;
2524

2625
&::before {
2726
position: absolute;
2827
content: '';
29-
height: 12px;
30-
width: 12px;
28+
height: 14px;
29+
width: 14px;
3130
left: 3px;
3231
bottom: 3px;
3332
background-color: white;
@@ -39,7 +38,6 @@
3938

4039
input:checked + .slider {
4140
background-color: var(--vscode-button-background);
42-
border-color: transparent;
4341
}
4442

4543
input:checked + .slider:before {

‎packages/ui/src/components/editor/settings/ConfigurationsList/ConfigurationsList.module.scss‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,43 @@
11
.container {
22
display: flex;
33
flex-direction: column;
4+
--row-height: 40px;
45
}
56

67
.header {
78
display: flex;
8-
padding: 12px 12px 12px 16px;
9+
padding: 0 12px 0 16px;
910
align-items: center;
1011
justify-content: space-between;
12+
height: var(--row-height);
1113

1214
&__left {
1315
display: flex;
1416
align-items: center;
1517
gap: 5px;
1618

1719
&__amount {
18-
font-weight: 600;
20+
font-weight: 500;
1921
}
2022
}
2123
}
2224

2325
.list {
2426
display: flex;
2527
flex-direction: column;
26-
overflow: hidden;
28+
border-top: 1px solid var(--cwc-bg-secondary);
29+
border-bottom: 1px solid var(--cwc-bg-secondary);
2730
}
2831

2932
.row {
3033
display: flex;
3134
align-items: center;
32-
height: 40px;
35+
height: var(--row-height);
3336
gap: 12px;
3437
padding: 0 12px;
3538
user-select: text;
3639

37-
&:nth-child(odd) {
40+
&:nth-child(even) {
3841
background-color: var(--cwc-bg-tertiary);
3942
}
4043

@@ -58,7 +61,7 @@
5861

5962
.drag-handle {
6063
cursor: grab;
61-
opacity: 0.5;
64+
opacity: var(--drag-handle-opacity);
6265

6366
&:active {
6467
cursor: grabbing;

‎packages/ui/src/components/editor/settings/ConfigurationsList/ConfigurationsList.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ export const ConfigurationsList: React.FC<ConfigurationsList.Props> = (
126126
}
127127
}}
128128
tag="div"
129-
handle={`.${styles['drag-handle']}`}
130129
animation={150}
131130
>
132131
{props.configurations.map((item, index) =>

‎packages/ui/src/components/editor/settings/ModelProviders/ModelProviders.module.scss‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
.container {
22
display: flex;
33
flex-direction: column;
4+
--row-height: 40px;
45
}
56

67
.header {
78
display: flex;
8-
padding: 12px 12px 12px 16px;
9+
padding: 0 12px 0 16px;
10+
height: var(--row-height);
911
align-items: center;
1012
justify-content: space-between;
1113

1214
&__amount {
13-
font-weight: 600;
15+
font-weight: 500;
1416
}
1517
}
1618

1719
.list {
1820
display: flex;
1921
flex-direction: column;
20-
overflow: hidden;
22+
border-top: 1px solid var(--cwc-bg-secondary);
23+
border-bottom: 1px solid var(--cwc-bg-secondary);
2124
}
2225

2326
.row {
2427
display: flex;
2528
align-items: center;
26-
height: 40px;
29+
height: var(--row-height);
2730
padding: 0 12px;
2831
gap: 12px;
2932
user-select: text;
3033

31-
&:nth-child(odd) {
34+
&:nth-child(even) {
3235
background-color: var(--cwc-bg-tertiary);
3336
}
3437

@@ -72,7 +75,7 @@
7275

7376
.drag-handle {
7477
cursor: grab;
75-
opacity: 0.5;
78+
opacity: var(--drag-handle-opacity);
7679

7780
&:active {
7881
cursor: grabbing;

‎packages/ui/src/components/editor/settings/ModelProviders/ModelProviders.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ export const ModelProviders: React.FC<ModelProviders.Props> = (props) => {
109109
}
110110
}}
111111
tag="div"
112-
handle={`.${styles['drag-handle']}`}
113112
animation={150}
114113
>
115114
{props.providers.map((p, i) => render_item(p, i))}

‎packages/ui/src/components/editor/settings/Section/Section.module.scss‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
gap: 16px;
5050
}
5151

52+
&__content {
53+
display: flex;
54+
flex-direction: column;
55+
gap: 4px;
56+
}
57+
5258
&__group {
5359
font-weight: 400;
5460
color: var(--vscode-textLink-foreground);

‎packages/ui/src/components/editor/settings/Section/Section.tsx‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,19 @@ export const Section = forwardRef<HTMLDivElement, Props>((props, ref) => {
9292
>
9393
<div className={styles.header__marker} ref={marker_ref} />
9494
<div className={styles.header__top}>
95-
<div className={styles.header__title}>
96-
{props.group && (
97-
<span className={styles.header__group}>{props.group}: </span>
98-
)}
99-
{props.title}
95+
<div className={styles.header__content}>
96+
<div className={styles.header__title}>
97+
{props.group && (
98+
<span className={styles.header__group}>{props.group}: </span>
99+
)}
100+
{props.title}
101+
</div>
102+
<div className={styles.header__subtitle}>{props.subtitle}</div>
100103
</div>
101104
{props.actions && (
102105
<div className={styles.header__actions}>{props.actions}</div>
103106
)}
104107
</div>
105-
<div className={styles.header__subtitle}>{props.subtitle}</div>
106108
</div>
107109
{props.children}
108110
</div>

‎packages/ui/src/styles/foundation/_variables.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
--disabled-opacity: 0.5;
55
--dimmed-opacity: 0.7;
6-
--drag-handle-opacity: 0.5;
6+
--drag-handle-opacity: 0.6;
77

88
--transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
99
--transition-duration-150: 0.15s;

0 commit comments

Comments
 (0)