Skip to content

Commit 8c70eee

Browse files
committed
Move background and border-radius styles from Group to Item components
- move hoverable onto .container
1 parent b8648e1 commit 8c70eee

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
}
1212

1313
.container {
14-
border-radius: 10px;
1514
color: var(--vscode-sideBarTitle-foreground);
16-
background-color: var(--cwc-bg-tertiary);
17-
overflow: hidden;
15+
1816

1917
> div {
2018
border-top: 1px solid var(--cwc-border-color-dimmed);

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
display: flex;
33
flex-direction: column;
44
gap: 6px;
5+
background-color: var(--cwc-bg-tertiary);
6+
7+
&--hoverable:hover:not(:has(button:hover, a:hover)) {
8+
background-color: var(--vscode-toolbar-hoverBackground);
9+
}
10+
11+
&:first-child {
12+
border-top-left-radius: 10px;
13+
border-top-right-radius: 10px;
14+
}
15+
16+
&:last-child {
17+
border-bottom-left-radius: 10px;
18+
border-bottom-right-radius: 10px;
19+
}
520
}
621

722
.main {
@@ -15,10 +30,6 @@
1530
cursor: pointer;
1631
user-select: none;
1732
}
18-
19-
&--hoverable:hover:not(:has(button:hover, a:hover)) {
20-
background-color: var(--vscode-toolbar-hoverBackground);
21-
}
2233
}
2334

2435
.content {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ export const Item: React.FC<Props> = (props) => {
1919
const [is_expanded, set_is_expanded] = useState(false)
2020

2121
return (
22-
<div className={styles.container}>
22+
<div
23+
className={cn(styles.container, {
24+
[styles['container--hoverable']]: props.is_toggleable && !is_expanded
25+
})}
26+
>
2327
<div
2428
className={cn(styles.main, {
2529
[styles['main--toggleable']]: props.is_toggleable,
26-
[styles['main--hoverable']]: props.is_toggleable && !is_expanded
2730
})}
2831
onClick={props.is_toggleable ? () => set_is_expanded(!is_expanded) : undefined}
2932
>

0 commit comments

Comments
 (0)