diff options
Diffstat (limited to 'src/features/appearance')
-rw-r--r-- | src/features/appearance/index.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/features/appearance/index.ts b/src/features/appearance/index.ts index b3cbd3347..9c9f3e175 100644 --- a/src/features/appearance/index.ts +++ b/src/features/appearance/index.ts | |||
@@ -2,6 +2,7 @@ import color from 'color'; | |||
2 | import { reaction } from 'mobx'; | 2 | import { reaction } from 'mobx'; |
3 | import TopBarProgress from 'react-topbar-progress-indicator'; | 3 | import TopBarProgress from 'react-topbar-progress-indicator'; |
4 | 4 | ||
5 | import { pathExistsSync, readFileSync } from 'fs-extra'; | ||
5 | import { isWindows, isLinux } from '../../environment'; | 6 | import { isWindows, isLinux } from '../../environment'; |
6 | import { | 7 | import { |
7 | DEFAULT_APP_SETTINGS, | 8 | DEFAULT_APP_SETTINGS, |
@@ -10,6 +11,7 @@ import { | |||
10 | SIDEBAR_SERVICES_LOCATION_CENTER, | 11 | SIDEBAR_SERVICES_LOCATION_CENTER, |
11 | SIDEBAR_SERVICES_LOCATION_BOTTOMRIGHT, | 12 | SIDEBAR_SERVICES_LOCATION_BOTTOMRIGHT, |
12 | } from '../../config'; | 13 | } from '../../config'; |
14 | import { userDataPath } from '../../environment-remote'; | ||
13 | 15 | ||
14 | const STYLE_ELEMENT_ID = 'custom-appearance-style'; | 16 | const STYLE_ELEMENT_ID = 'custom-appearance-style'; |
15 | 17 | ||
@@ -34,6 +36,11 @@ function darkenAbsolute(originalColor, absoluteChange) { | |||
34 | return originalColor.lightness(originalLightness - absoluteChange); | 36 | return originalColor.lightness(originalLightness - absoluteChange); |
35 | } | 37 | } |
36 | 38 | ||
39 | function generateUserCustomCSS() { | ||
40 | const path = userDataPath('config', 'custom.css'); | ||
41 | return pathExistsSync(path) ? readFileSync(path).toString() : ''; | ||
42 | } | ||
43 | |||
37 | function generateAccentStyle(accentColorStr) { | 44 | function generateAccentStyle(accentColorStr) { |
38 | let accentColor; | 45 | let accentColor; |
39 | try { | 46 | try { |
@@ -421,6 +428,8 @@ function generateStyle(settings, app) { | |||
421 | style += generateOpenWorkspaceStyle(); | 428 | style += generateOpenWorkspaceStyle(); |
422 | } | 429 | } |
423 | 430 | ||
431 | style += generateUserCustomCSS(); | ||
432 | |||
424 | return style; | 433 | return style; |
425 | } | 434 | } |
426 | 435 | ||