Skip to content

Commit

Permalink
[core] Improve selector clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Feb 28, 2024
1 parent ffedb8e commit 839b093
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
10 changes: 4 additions & 6 deletions packages/x-charts/src/ChartsTooltip/ChartsTooltipTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export const ChartsTooltipRow = styled('tr', {
name: 'MuiChartsTooltip',
slot: 'Row',
})(({ theme }) => ({
'tr:first-of-type& td': {
'& tr:first-of-type& td': {
paddingTop: theme.spacing(1),
},
'tr:last-of-type& td': {
'& tr:last-of-type& td': {
paddingBottom: theme.spacing(1),
},
}));
Expand All @@ -41,19 +41,17 @@ export const ChartsTooltipCell = styled('td', {
})(({ theme }) => ({
verticalAlign: 'middle',
color: (theme.vars || theme).palette.text.secondary,

[`&.${chartsTooltipClasses.labelCell}`]: {
paddingLeft: theme.spacing(1),
},
[`&.${chartsTooltipClasses.valueCell}`]: {
paddingLeft: theme.spacing(4),
color: (theme.vars || theme).palette.text.primary,
},

'td:first-of-type&': {
'& td:first-of-type&': {
paddingLeft: theme.spacing(2),
},
'td:last-of-type&': {
'& td:last-of-type&': {
paddingRight: theme.spacing(2),
},
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ function DefaultChartsAxisTooltipContent(props: ChartsAxisContentProps) {
className={classes.mark}
/>
</ChartsTooltipCell>

<ChartsTooltipCell className={clsx(classes.labelCell, classes.cell)}>
{label ? <Typography>{label}</Typography> : null}
</ChartsTooltipCell>

<ChartsTooltipCell className={clsx(classes.valueCell, classes.cell)}>
<Typography>{formattedValue}</Typography>
</ChartsTooltipCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ function DefaultChartsItemTooltipContent<T extends ChartSeriesType = ChartSeries
<ChartsTooltipCell className={clsx(classes.markCell, classes.cell)}>
<ChartsTooltipMark ownerState={{ color }} className={classes.mark} />
</ChartsTooltipCell>

<ChartsTooltipCell className={clsx(classes.labelCell, classes.cell)}>
{displayedLabel}
</ChartsTooltipCell>

<ChartsTooltipCell className={clsx(classes.valueCell, classes.cell)}>
{formattedValue}
</ChartsTooltipCell>
Expand Down

0 comments on commit 839b093

Please sign in to comment.