Skip to content

Commit

Permalink
chore: changing mui theme spacing
Browse files Browse the repository at this point in the history
- decreasing the spacing size from 5 to 4: Closes [#43](#43)
- round down floating point numbers: Closes [#33](#33)
  • Loading branch information
marcosh-ramos committed Jan 13, 2025
1 parent 462e56e commit c841b5e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/theme/light-theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const shadows = [
),
] as Theme['shadows']

const spacing = 5
const spacing = (factor: number = 1) => Math.floor(factor) * 4

const palette = {
mode: 'light',
Expand Down Expand Up @@ -144,8 +144,8 @@ const typography: ThemeOptions['typography'] = {
fontWeightMedium: font_weight_medium,
fontWeightBold: font_weight_bold,
h1: {
marginTop: spacing * 2,
marginBottom: spacing * 2,
marginTop: spacing(2),
marginBottom: spacing(2),
fontWeight: font_weight_bold,
letterSpacing: 0,
fontSize: heading_xl,
Expand Down Expand Up @@ -596,14 +596,14 @@ const lightTheme = createTheme({
MuiFormHelperText: {
styleOverrides: {
root: {
marginTop: spacing,
marginTop: spacing(),
},
},
},
MuiFormLabel: {
styleOverrides: {
root: {
marginBottom: spacing * 2,
marginBottom: spacing(2),
color: `${palette.text.primary} !important`,
fontSize: font_14,
fontWeight: font_weight_medium,
Expand All @@ -626,8 +626,8 @@ const lightTheme = createTheme({
styleOverrides: {
select: {
paddingLeft: '17px',
paddingTop: spacing * 2,
paddingBottom: spacing * 2,
paddingTop: spacing(2),
paddingBottom: spacing(2),
display: 'flex',
alignItems: 'center',
},
Expand All @@ -650,7 +650,7 @@ const lightTheme = createTheme({
MuiMenu: {
styleOverrides: {
root: {
marginTop: spacing * 2,
marginTop: spacing(2),
boxShadow: shadows[24],
},
},
Expand Down Expand Up @@ -761,17 +761,17 @@ const lightTheme = createTheme({
styleOverrides: {
root: {
borderRadius: base_border_radius,
paddingLeft: spacing,
paddingRight: spacing,
paddingLeft: spacing(),
paddingRight: spacing(),
height: 24,
fontWeight: typography.fontWeightBold,
fontSize: font_13,
lineHeight: font_13,
},
label: {
padding: 0,
marginLeft: spacing,
marginRight: spacing,
marginLeft: spacing(),
marginRight: spacing(),
},
icon: {
margin: 0,
Expand Down

0 comments on commit c841b5e

Please sign in to comment.