diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-05-06 14:47:56 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-05-06 14:47:56 +0530 |
commit | f7ada6916541047f8ddf6eb2d1a45ddc3b9dead0 (patch) | |
tree | eec5be51e59fff9d93107133d7b818482cbed93c /modern/src/theme | |
parent | 73623e1eccde7160fa83b79ad96ae744fa357a32 (diff) | |
download | trackermap-web-f7ada6916541047f8ddf6eb2d1a45ddc3b9dead0.tar.gz trackermap-web-f7ada6916541047f8ddf6eb2d1a45ddc3b9dead0.tar.bz2 trackermap-web-f7ada6916541047f8ddf6eb2d1a45ddc3b9dead0.zip |
More code improvement
Diffstat (limited to 'modern/src/theme')
-rw-r--r-- | modern/src/theme/dimensions.js | 7 | ||||
-rw-r--r-- | modern/src/theme/index.js | 12 | ||||
-rw-r--r-- | modern/src/theme/overrides.js | 48 | ||||
-rw-r--r-- | modern/src/theme/palette.js | 19 |
4 files changed, 86 insertions, 0 deletions
diff --git a/modern/src/theme/dimensions.js b/modern/src/theme/dimensions.js new file mode 100644 index 00000000..bc20cb91 --- /dev/null +++ b/modern/src/theme/dimensions.js @@ -0,0 +1,7 @@ +export default { + inputHeight: 42, + borderRadius: 4, + maxFormWidth: 335, + sidebarWidth: 28, + minSidebarWidth: 52 +}; diff --git a/modern/src/theme/index.js b/modern/src/theme/index.js new file mode 100644 index 00000000..5a3b2a9c --- /dev/null +++ b/modern/src/theme/index.js @@ -0,0 +1,12 @@ +import { createMuiTheme } from '@material-ui/core/styles'; +import palette from './palette'; +import overrides from './overrides'; +import dimensions from './dimensions'; + +const theme = createMuiTheme({ + palette, + overrides, + dimensions +}); + +export default theme; diff --git a/modern/src/theme/overrides.js b/modern/src/theme/overrides.js new file mode 100644 index 00000000..021770b7 --- /dev/null +++ b/modern/src/theme/overrides.js @@ -0,0 +1,48 @@ +import dimensions from './dimensions'; + +export default { + MuiFormControl: { + root: { + height: dimensions.inputHeight, + } + }, + MuiInputLabel: { + filled: { + transform: 'translate(12px, 14px) scale(1)', + '&$shrink' :{ + transform: 'translate(12px, -12px) scale(0.75)' + } + }, + }, + MuiFilledInput: { + root: { + height: dimensions.inputHeight, + borderRadius: dimensions.borderRadius, + }, + input: { + height: dimensions.inputHeight, + borderRadius: dimensions.borderRadius, + paddingTop: '10px', + boxSizing: 'border-box', + '&:-webkit-autofill': { + WebkitBoxShadow: '0 0 0 100px #eeeeee inset', + }, + }, + underline: { + "&:before": { + borderBottom: 'none', + }, + "&:after": { + borderBottom: 'none', + }, + "&:hover:before": { + borderBottom: 'none', + }, + } + }, + MuiButton: { + root: { + height: dimensions.inputHeight, + } + } +}; diff --git a/modern/src/theme/palette.js b/modern/src/theme/palette.js new file mode 100644 index 00000000..24aefce1 --- /dev/null +++ b/modern/src/theme/palette.js @@ -0,0 +1,19 @@ +import { deepPurple, green } from '@material-ui/core/colors'; + +const traccarPurple = deepPurple[500]; +const traccarGreen = green[500]; +const traccarWhite = '#FFF'; + +export default { + common: { + purple: traccarPurple, + green: traccarGreen + }, + primary: { + main: traccarPurple + }, + secondary: { + main: traccarGreen, + contrastText: traccarWhite + } +}; |