Skip to content

Commit 50e129c

Browse files
committed
feat(editor2): better appearance for card shadows
1 parent f26f273 commit 50e129c

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

src/components/editor2/action/ActionItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const ActionItem: FC<ActionItemProps> = memo(
103103
<Card
104104
className={clsx(
105105
className,
106-
'!p-0 !rounded overflow-hidden',
106+
'card-shadow-subtle !p-0 !rounded overflow-hidden',
107107
typeInfo.accentText,
108108
)}
109109
>

src/components/editor2/operator/GroupItem.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ export const GroupItem: FC<GroupItemProps> = memo(({ baseGroupAtom }) => {
9696

9797
return (
9898
<Card
99-
elevation={Elevation.ONE}
10099
className={clsx(
101-
'!p-0 flex flex-col overflow-hidden',
100+
'card-shadow-subtle !p-0 flex flex-col overflow-hidden',
102101
active ? 'ring ring-purple-500 !border-0 !shadow-none' : '',
103102
)}
104103
>

src/components/editor2/operator/OperatorItem.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ export const OperatorItem: FC<OperatorItemProps> = memo(
110110
>
111111
<Card
112112
interactive
113-
elevation={Elevation.ONE}
114-
className="relative w-24 p-0 !py-0 flex flex-col overflow-hidden select-none pointer-events-auto"
113+
className="card-shadow-subtle relative w-24 p-0 !py-0 flex flex-col overflow-hidden select-none pointer-events-auto"
115114
{...attributes}
116115
{...listeners}
117116
>

src/styles/global.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ body,
5858
}
5959
}
6060

61+
.card-shadow-subtle {
62+
box-shadow:
63+
0 0 3px 1px #0001,
64+
0 2px 3px #0001;
65+
66+
&.bp4-interactive:hover {
67+
box-shadow:
68+
0 2px 4px #0002,
69+
0 8px 24px #0003;
70+
}
71+
72+
.dark & {
73+
box-shadow: 0 0px 3px #fff9;
74+
}
75+
}
76+
6177
.bg-rainbow {
6278
background: linear-gradient(
6379
90deg,

0 commit comments

Comments
 (0)