Skip to content

Commit 516e59e

Browse files
author
mrmrs
committed
Fixes overlapping vontent in layer tree.
Also adds background color to selected node in tree
1 parent 17d1057 commit 516e59e

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

packages/gui/src/components/html/Editors/NodeEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export function NodeEditor({
5858
borderBottomWidth: '1px',
5959
borderBottomStyle: 'solid',
6060
borderBottomColor: 'border',
61+
zIndex: 4,
6162
}}
6263
>
6364
<div

packages/gui/src/components/html/TreeNode.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,16 @@ export function TreeNode({ value, path, onSelect, onChange }: TreeNodeProps) {
162162
const tagButton = (
163163
<button
164164
sx={{
165+
appearance: 'none',
166+
WebkitAppearance: 'none',
165167
cursor: 'pointer',
166168
border: 'none',
167-
backgroundColor: 'background',
169+
backgroundColor: isSelected ? '#ff0' : 'background',
168170
color: 'text',
169-
fontSize: 1,
170-
fontWeight: isSelected ? 600 : 400,
171-
px: 0,
171+
fontSize: '14px',
172+
fontWeight: isSelected ? 700 : 400,
173+
borderRadius: '6px',
174+
px: 2,
172175
mr: 0,
173176
ml: 0,
174177
textAlign: 'start',
@@ -216,7 +219,7 @@ export function TreeNode({ value, path, onSelect, onChange }: TreeNodeProps) {
216219
},
217220
}}
218221
/>
219-
<span sx={{ lineHeight: 1, fontFamily: 'monospace' }}>{tagButton}</span>
222+
<span sx={{ fontSize: 1, lineHeight: 1, fontFamily: 'monospace' }}>{tagButton}</span>
220223
<Collapsible.Content>
221224
<div sx={{ ml: 4, py: '0.0625rem' }}>
222225
{value.children?.map((child, i) => {
@@ -281,11 +284,14 @@ export function TreeNode({ value, path, onSelect, onChange }: TreeNodeProps) {
281284
></div>
282285
<div
283286
sx={{
284-
fontWeight: isSelected ? 600 : 400,
285287
lineHeight: 1,
286-
p: 0,
287-
fontSize: 1,
288-
fontFamily: 'monospace',
288+
py: 0,
289+
px: 2,
290+
fontSize: '14px',
291+
bg: isSelected ? '#ff0' : 'background',
292+
fontWeight: isSelected ? 700 : 400,
293+
borderRadius: '6px',
294+
transition: 'background-color .2s ease-in-out',
289295
}}
290296
>
291297
&lt;/{value.tagName}&gt;

0 commit comments

Comments
 (0)