Back to all reviewers

Use design system tokens

mui/material-ui
Based on 3 comments
TSX

Always use design system tokens (theme values, breakpoints, spacing units) instead of hard-coded values. This ensures consistency across the codebase and makes maintenance easier when design changes are needed.

Code Style TSX

Reviewer Prompt

Always use design system tokens (theme values, breakpoints, spacing units) instead of hard-coded values. This ensures consistency across the codebase and makes maintenance easier when design changes are needed.

Bad:


<Grid sx={{ 
  width: '44px',
  fontWeight: 'bold',
  '@media (max-width: 640px)': {
    // ...
  }
}} />

Good:


<Grid sx={{ 
  width: theme.spacing(5.5), // or appropriate token
  fontWeight: theme.typography.fontWeightBold,
  [theme.breakpoints.down('sm')]: {
    // ...
  }
}} />

This practice:

  • Maintains visual consistency
  • Simplifies theme customization
  • Makes responsive design more maintainable
  • Reduces the need for magic numbers in the code
3
Comments Analyzed
TSX
Primary Language
Code Style
Category

Source Discussions