diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-23 08:10:14 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-23 08:10:14 -0700 |
commit | 145fd060b544ea7886c5b6b11b24fb3da9b93127 (patch) | |
tree | 4e0cef7a4467c6562949e5a0f14450b0bc4c4ffa /modern/src | |
parent | c40ef7ad640d595167dd0a3abab34f4c6a690764 (diff) | |
download | trackermap-web-145fd060b544ea7886c5b6b11b24fb3da9b93127.tar.gz trackermap-web-145fd060b544ea7886c5b6b11b24fb3da9b93127.tar.bz2 trackermap-web-145fd060b544ea7886c5b6b11b24fb3da9b93127.zip |
Add component defaults
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/common/theme/components.js | 15 | ||||
-rw-r--r-- | modern/src/common/theme/index.js | 2 | ||||
-rw-r--r-- | modern/src/common/theme/overrides.js | 87 |
3 files changed, 17 insertions, 87 deletions
diff --git a/modern/src/common/theme/components.js b/modern/src/common/theme/components.js new file mode 100644 index 00000000..f5f3acaa --- /dev/null +++ b/modern/src/common/theme/components.js @@ -0,0 +1,15 @@ +export default { + MuiFormControl: { + defaultProps: { + size: 'small', + }, + }, + MuiSnackbar: { + defaultProps: { + anchorOrigin: { + vertical: 'bottom', + horizontal: 'center', + }, + }, + }, +}; diff --git a/modern/src/common/theme/index.js b/modern/src/common/theme/index.js index 23fc0d73..0cc999ad 100644 --- a/modern/src/common/theme/index.js +++ b/modern/src/common/theme/index.js @@ -1,10 +1,12 @@ import { createTheme } from '@mui/material/styles'; import palette from './palette'; import dimensions from './dimensions'; +import components from './components'; const theme = createTheme({ palette, dimensions, + components, }); export default theme; diff --git a/modern/src/common/theme/overrides.js b/modern/src/common/theme/overrides.js deleted file mode 100644 index d1fe844c..00000000 --- a/modern/src/common/theme/overrides.js +++ /dev/null @@ -1,87 +0,0 @@ -import dimensions from './dimensions'; - -export default { - MuiFormControl: { - root: { - marginTop: 5, - marginBottom: 5, - }, - }, - MuiInputLabel: { - filled: { - transform: 'translate(12px, 14px) scale(1)', - '&$shrink': { - transform: 'translate(12px, -14px) scale(0.72)', - }, - }, - }, - MuiFilledInput: { - root: { - height: dimensions.inputHeight, - borderRadius: dimensions.borderRadius, - backgroundColor: 'rgba(0, 0, 0, 0.035)', - }, - input: { - height: dimensions.inputHeight, - borderRadius: dimensions.borderRadius, - paddingTop: '11.5px', - paddingBottom: '11.5px', - boxSizing: 'border-box', - '&:-webkit-autofill': { - WebkitBoxShadow: '0 0 0 100px #eeeeee inset', - }, - }, - underline: { - '&:before': { - borderBottom: 'none', - }, - '&:after': { - borderBottom: 'none', - }, - '&:hover:before': { - borderBottom: 'none', - }, - }, - }, - MuiSelect: { - select: { - borderRadius: dimensions.borderRadius, - '&&:focus': { - borderRadius: dimensions.borderRadius, - }, - }, - }, - MuiButton: { - root: { - height: dimensions.inputHeight, - marginTop: 5, - marginBottom: 5, - '&$disabled': { - opacity: 0.4, - color: undefined, - }, - }, - contained: { - '&$disabled': { - opacity: 0.4, - color: undefined, - backgroundColor: undefined, - }, - }, - }, - MuiFormHelperText: { - root: { - marginBottom: -10, - }, - contained: { - marginLeft: 12, - }, - }, - MuiAutocomplete: { - inputRoot: { - '&.MuiFilledInput-root': { - paddingTop: 0, - }, - }, - }, -}; |