rusackas commented on code in PR #27558:
URL: https://github.com/apache/superset/pull/27558#discussion_r1530567620


##########
superset-frontend/src/explore/components/controls/OptionControls/index.tsx:
##########
@@ -106,18 +106,46 @@ export const LabelsContainer = styled.div`
 export const DndLabelsContainer = styled.div<{
   canDrop?: boolean;
   isOver?: boolean;
+  isDragging?: boolean;
 }>`
+  position: relative;
   padding: ${({ theme }) => theme.gridUnit}px;
-  border: ${({ canDrop, isOver, theme }) => {
-    if (canDrop) {
-      return `dashed 1px ${theme.colors.info.dark1}`;
-    }
-    if (isOver && !canDrop) {
-      return `dashed 1px ${theme.colors.error.dark1}`;
+  border: ${({ canDrop, isDragging, theme }) => {
+    if (isDragging) {
+      return `dashed 1px ${
+        canDrop ? theme.colors.info.dark1 : theme.colors.error.dark1
+      }`;
     }
     return `solid 1px ${theme.colors.grayscale.light2}`;
   }};
   border-radius: ${({ theme }) => theme.gridUnit}px;
+  &:before,
+  &:after {
+    content: ' ';
+    position: absolute;
+    border-radius: ${({ theme }) => theme.gridUnit}px;
+  }
+  &:before {
+    display: ${({ isDragging }) => (isDragging ? 'block' : 'none')};
+    background-color: ${({ theme, canDrop }) =>
+      canDrop ? theme.colors.primary.base : theme.colors.error.light1};
+    z-index: 10;
+    opacity: 0.2;
+    top: 1px;
+    right: 1px;
+    bottom: 1px;
+    left: 1px;
+  }
+  &:after {
+    display: ${({ isOver, canDrop }) => (canDrop && isOver ? 'block' : 
'none')};
+    background-color: ${({ theme }) => theme.colors.primary.base};
+    z-index: 10;
+    opacity: 0.3;
+    top: -4px;

Review Comment:
   Same for the z-index/opacity here, but also, if these positions are based on 
the "drop zone" having a gridUnit of space, you might want to use the 
`gridUnit` here as well for these 4px offsets. Then if someone changes the 
gridUnit to 6px or 2px in their theme, it'll all line up nicely :D



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to