Skip to content

Commit 433e9f4

Browse files
committed
styling the reorder handle
1 parent 00ace6f commit 433e9f4

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

packages/components/src/styles/components/advanced-table.scss

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,27 @@ $hds-advanced-table-drag-preview-background-color: rgba(204, 227, 254, 30%);
8989
.hds-advanced-table__tr {
9090
display: contents;
9191

92+
.hds-advanced-table__th-reorder-handle {
93+
z-index: 2;
94+
display: none;
95+
align-items: center;
96+
justify-content: center;
97+
width: 24px;
98+
height: 24px;
99+
margin: -2px 0;
100+
background-color: var(--token-color-surface-primary);
101+
border: 1px solid $hds-advanced-table-border-color;
102+
border-radius: var(--token-border-radius-x-small);
103+
104+
&:hover {
105+
cursor: grab;
106+
}
107+
108+
&:active {
109+
cursor: grabbing;
110+
}
111+
}
112+
92113
.hds-advanced-table__th {
93114
position: relative;
94115
align-content: center;
@@ -98,6 +119,11 @@ $hds-advanced-table-drag-preview-background-color: rgba(204, 227, 254, 30%);
98119
text-align: left;
99120
background-color: var(--token-color-surface-strong);
100121

122+
&:hover .hds-advanced-table__th-reorder-handle,
123+
&.mock-hover .hds-advanced-table__th-reorder-handle {
124+
display: flex;
125+
}
126+
101127
&:focus,
102128
&.mock-focus {
103129
// the box shadow is 3px wide, so offsetting by 3px so the focus ring doesn't go outside the cell
@@ -167,26 +193,6 @@ $hds-advanced-table-drag-preview-background-color: rgba(204, 227, 254, 30%);
167193
transform: translateX(0);
168194
}
169195

170-
.hds-advanced-table__th-reorder-handle {
171-
position: absolute;
172-
top: 0;
173-
left: 50%;
174-
z-index: 2;
175-
width: 24px;
176-
height: 24px;
177-
background-color: var(--token-color-surface-primary);
178-
border: 1px solid $hds-advanced-table-border-color;
179-
border-radius: var(--token-border-radius-x-small);
180-
181-
&:hover {
182-
cursor: grab;
183-
}
184-
185-
&:active {
186-
cursor: grabbing;
187-
}
188-
}
189-
190196
.hds-advanced-table__th-resize-handle {
191197
@include hds-focus-ring-with-pseudo-element($position: absolute);
192198

0 commit comments

Comments
 (0)