mirror of
https://github.com/desktop/desktop
synced 2024-09-19 08:02:22 +00:00
Merge pull request #14142 from rakleed/dark-scrollbar
Make dark scrollbar in dark theme
This commit is contained in:
commit
bf54e40e5c
|
@ -63,9 +63,17 @@ export class AppTheme extends React.PureComponent<IAppThemeProps> {
|
|||
) {
|
||||
this.clearThemes()
|
||||
body.classList.add(newThemeClassName)
|
||||
this.updateColorScheme()
|
||||
}
|
||||
}
|
||||
|
||||
private updateColorScheme = () => {
|
||||
const isDarkTheme = document.body.classList.contains('theme-dark')
|
||||
const rootStyle = document.documentElement.style
|
||||
|
||||
rootStyle.colorScheme = isDarkTheme ? 'dark' : 'light'
|
||||
}
|
||||
|
||||
/**
|
||||
* This takes a custom theme object and applies it over top either our dark or
|
||||
* light theme dynamically creating a new variables style sheet.
|
||||
|
@ -102,6 +110,7 @@ export class AppTheme extends React.PureComponent<IAppThemeProps> {
|
|||
styles.appendChild(document.createTextNode(customThemeStyles))
|
||||
|
||||
body.appendChild(styles)
|
||||
this.updateColorScheme()
|
||||
}
|
||||
|
||||
private clearThemes() {
|
||||
|
|
Loading…
Reference in a new issue