Skip to content

Commit

Permalink
chore(react): improve drag source styles
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Aug 20, 2021
1 parent 87289d3 commit 354a7b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 9 additions & 0 deletions packages/playground/src/main.tsx
Expand Up @@ -140,6 +140,15 @@ GlobalDragSource.setSourcesByGroup('form', [
'x-component': 'Card',
},
},
{
componentName: 'Card',
props: {
title: '卡片',
type: 'void',
'x-decorator': 'FormItem',
'x-component': 'Card',
},
},
])

GlobalRegistry.registerDesignerLocales({
Expand Down
9 changes: 5 additions & 4 deletions packages/react/src/widgets/DragSourceWidget/styles.less
Expand Up @@ -56,7 +56,7 @@
&-item {
user-select: none;
padding: 8px 10px;
width: calc(50% + 2px);
width: calc(50% + 1px);
min-height: 40px;
margin: -1px;
margin-bottom: 0;
Expand All @@ -68,14 +68,15 @@
flex-direction: column;
font-size: 13px;
cursor: grab;
transition: all 0.1s ease-out;
transition: color 0.1s ease-out;

&:hover {
color: var(--dn-drag-source-item-hover-color);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

&:nth-child(2n) {
border-left: none;
margin-left: 0;
}
}
}
}

0 comments on commit 354a7b5

Please sign in to comment.