lyft / clutch

Extensible platform for infrastructure management
https://clutch.sh
Apache License 2.0
1.7k stars 120 forks source link

frontend: Set theme spacing #3138

Closed septum closed 1 month ago

septum commented 1 month ago

Description

Testing Performed

Manual testing

jecr commented 1 month ago

Just to get a clearer idea, how would this be used in the field?, does this replace the values the current theme.spacing outputs?

septum commented 1 month ago

Just to get a clearer idea, how would this be used in the field?, does this replace the values the current theme.spacing outputs?

Copy-pasting the example from above, it's expected to be used as the following examples:

<Grid
- spacing={2}
+ spacing={ThemeSpacing.Base}
>
  <Component />
 </Grid>
const StyledComponent = styled(Component)(({ theme }: { theme: Theme }) => ({
- margin: "24px",
+ margin: theme.spacing(ThemeSpacing.Medium),
}));