Skip to content

Commit

Permalink
🔥 more cleanup
Browse files Browse the repository at this point in the history
- move flex CSS specific to default height cells to its selector, vs. the baseline actions component
  • Loading branch information
cee-chen committed Oct 4, 2023
1 parent e41d973 commit 4c4dc57
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
24 changes: 13 additions & 11 deletions src/components/datagrid/_data_grid_data_row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
flex-grow: 1;
}

.euiDataGridRowCell__actions {
flex-grow: 0;
}

.euiDataGridRowCell--controlColumn & {
height: 100%;
align-items: center;
Expand All @@ -130,16 +134,14 @@
// Cell actions
.euiDataGridRowCell__actions {
display: flex;
}
.euiDataGridRowCell__actions--flex {
flex-grow: 0;
}
.euiDataGridRowCell__actions--overlay {
position: absolute;
right: 0;
top: 0;
padding: $euiDataGridCellPaddingM 0;
background-color: $euiColorEmptyShade;

&--overlay {
position: absolute;
right: 0;
top: 0;
padding: $euiDataGridCellPaddingM 0;
background-color: $euiColorEmptyShade;
}
}

.euiDataGridRowCell__actionButtonIcon {
Expand Down Expand Up @@ -221,7 +223,7 @@
padding: ($euiDataGridCellPaddingS / 2) 0;
}

.euiDataGridRowCell__actions--flex {
.euiDataGridRowCell__defaultHeight .euiDataGridRowCell__actions {
transform: translateY(1px);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/datagrid/body/data_grid_cell_actions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('EuiDataGridCellActions', () => {

expect(component).toMatchInlineSnapshot(`
<div
className="euiDataGridRowCell__actions euiDataGridRowCell__actions--flex"
className="euiDataGridRowCell__actions"
>
<EuiI18n
default="Click or hit enter to interact with cell content"
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('EuiDataGridCellActions', () => {

expect(component).toMatchInlineSnapshot(`
<div
className="euiDataGridRowCell__actions euiDataGridRowCell__actions--flex"
className="euiDataGridRowCell__actions"
>
<MockAction
Component={[Function]}
Expand Down
1 change: 0 additions & 1 deletion src/components/datagrid/body/data_grid_cell_actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const EuiDataGridCellActions = ({
}, [column, colIndex, rowIndex]);

const classes = classNames('euiDataGridRowCell__actions', {
'euiDataGridRowCell__actions--flex': cellHeightType === 'default',
'euiDataGridRowCell__actions--overlay': cellHeightType !== 'default',
});

Expand Down

0 comments on commit 4c4dc57

Please sign in to comment.