Skip to content

Commit 20de7eb

Browse files
authored
Table style tweaks (#1340)
Summary: Makes table headers a bit more visible and consistent. <img width="590" alt="image" src="https://github.com/pixie-io/pixie/assets/314133/4da8998c-c2ad-47ae-ac1d-b25da60c46ad"> Type of change: /kind bugfix Test Plan: Look at live data tables. Header row should be more visible and distinguishable from body rows. Gear icon should be a bit smaller too, and the row/column borders are now the same color. Signed-off-by: Nick Lanam <nlanam@pixielabs.ai>
1 parent aed2190 commit 20de7eb

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

src/ui/src/components/data-table/data-table.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ const useDataTableStyles = makeStyles((theme: Theme) => createStyles({
7272
display: 'flex',
7373
maxHeight: '100%',
7474
width: '100%',
75-
backgroundColor: theme.palette.background.four,
76-
borderBottom: `1px ${theme.palette.background.two} solid`,
77-
color: theme.palette.foreground.three,
75+
backgroundColor: theme.palette.background.three,
76+
borderBottom: `1px ${theme.palette.background.six} solid`,
77+
color: theme.palette.foreground.one,
7878
textTransform: 'uppercase',
7979
},
8080
headerCell: {
8181
position: 'relative', // In case anything inside positions absolutely
8282
fontSize: theme.typography.pxToRem(14),
8383
padding: theme.spacing(1),
8484
alignSelf: 'baseline',
85-
borderRight: `1px ${theme.palette.background.two} dashed`,
85+
borderRight: `1px ${theme.palette.background.six} dashed`,
8686
'&:last-child': {
8787
borderRightWidth: 0,
8888
},
@@ -137,7 +137,7 @@ const useDataTableStyles = makeStyles((theme: Theme) => createStyles({
137137
alignItems: 'center',
138138
padding: `0 ${theme.spacing(1)}`,
139139
height: `${ROW_HEIGHT_PX}px`, // Ensures the border stretches. See cellContents for the rest.
140-
borderRight: `1px solid ${theme.palette.background.two}`,
140+
borderRight: `1px solid ${theme.palette.background.six}`,
141141
'&:last-of-type': {
142142
borderRightWidth: 0,
143143
},
@@ -163,7 +163,7 @@ const useDataTableStyles = makeStyles((theme: Theme) => createStyles({
163163
center: { textAlign: 'center' },
164164
fill: { textAlign: 'center' },
165165
sortButton: {
166-
opacity: 0.2,
166+
opacity: 0.5,
167167
width: theme.spacing(3),
168168
paddingLeft: theme.spacing(1),
169169
},
@@ -205,6 +205,11 @@ const useDataTableStyles = makeStyles((theme: Theme) => createStyles({
205205
columnMenuFew: { // Logic to expand columns first, then overflow into rows, is not possible in pure CSS :(
206206
gridTemplateColumns: '1fr',
207207
},
208+
gearButton: {
209+
marginRight: theme.spacing(-1),
210+
fontSize: theme.spacing(2.25),
211+
'& > svg': { fontSize: 'inherit' },
212+
},
208213
}), { name: 'DataTable' });
209214

210215
export interface DataTableProps {
@@ -261,7 +266,7 @@ const ColumnSelector = React.memo(() => {
261266
))}
262267
</Menu>
263268
{/* eslint-disable-next-line react-memo/require-usememo */}
264-
<IconButton onClick={toggleOpen} ref={anchorEl} size='small' sx={{ mr: -1 }}>
269+
<IconButton onClick={toggleOpen} ref={anchorEl} size='small' className={classes.gearButton}>
265270
<GearIcon />
266271
</IconButton>
267272
</>

0 commit comments

Comments
 (0)