diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-08 11:48:09 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-08 11:48:09 -0700 |
commit | 2352071211b61c10fa5bf5736baaff7809d18bf0 (patch) | |
tree | 743e4adc1cc35fb3585b912daaa8719ae5757f60 /modern/src/common/theme | |
parent | 044733ff543156d76437daae8edb66850d785ac9 (diff) | |
download | trackermap-web-2352071211b61c10fa5bf5736baaff7809d18bf0.tar.gz trackermap-web-2352071211b61c10fa5bf5736baaff7809d18bf0.tar.bz2 trackermap-web-2352071211b61c10fa5bf5736baaff7809d18bf0.zip |
Organize common code
Diffstat (limited to 'modern/src/common/theme')
-rw-r--r-- | modern/src/common/theme/dimensions.js | 15 | ||||
-rw-r--r-- | modern/src/common/theme/index.js | 12 | ||||
-rw-r--r-- | modern/src/common/theme/overrides.js | 87 | ||||
-rw-r--r-- | modern/src/common/theme/palette.js | 16 |
4 files changed, 130 insertions, 0 deletions
diff --git a/modern/src/common/theme/dimensions.js b/modern/src/common/theme/dimensions.js new file mode 100644 index 00000000..fa7d3b25 --- /dev/null +++ b/modern/src/common/theme/dimensions.js @@ -0,0 +1,15 @@ +export default { + inputHeight: '42px', + borderRadius: '4px', + sidebarWidth: '28%', + sidebarWidthTablet: '52px', + drawerWidthDesktop: '360px', + drawerWidthTablet: '320px', + bottomBarHeight: 56, + columnWidthDate: 160, + columnWidthNumber: 130, + columnWidthString: 160, + columnWidthBoolean: 130, + popupMapOffset: 300, + popupMaxWidth: 272, +}; diff --git a/modern/src/common/theme/index.js b/modern/src/common/theme/index.js new file mode 100644 index 00000000..02865c23 --- /dev/null +++ b/modern/src/common/theme/index.js @@ -0,0 +1,12 @@ +import { createTheme } from '@material-ui/core/styles'; +import palette from './palette'; +import overrides from './overrides'; +import dimensions from './dimensions'; + +const theme = createTheme({ + palette, + overrides, + dimensions, +}); + +export default theme; diff --git a/modern/src/common/theme/overrides.js b/modern/src/common/theme/overrides.js new file mode 100644 index 00000000..d1fe844c --- /dev/null +++ b/modern/src/common/theme/overrides.js @@ -0,0 +1,87 @@ +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, + }, + }, + }, +}; diff --git a/modern/src/common/theme/palette.js b/modern/src/common/theme/palette.js new file mode 100644 index 00000000..02261950 --- /dev/null +++ b/modern/src/common/theme/palette.js @@ -0,0 +1,16 @@ +export default { + primary: { + main: '#1a237e', + }, + secondary: { + main: '#4caf50', + contrastText: '#ffffff', + }, + colors: { + white: '#ffffff', + positive: '#4caf50', + medium: '#ffa000', + negative: '#f44336', + neutral: '#9e9e9e', + }, +}; |