@@ -16,6 +16,7 @@ import { ColorIdentifier, Extensions, IColorRegistry } from 'vs/platform/theme/c
1616import { Extensions as ThemingExtensions , ICssStyleCollector , IFileIconTheme , IThemingRegistry , ITokenStyle } from 'vs/platform/theme/common/themeService' ;
1717import { IDisposable , Disposable } from 'vs/base/common/lifecycle' ;
1818import { ColorScheme } from 'vs/platform/theme/common/theme' ;
19+ import { CodiconStyles } from 'vs/base/browser/ui/codicons/codiconStyles' ;
1920
2021const VS_THEME_NAME = 'vs' ;
2122const VS_DARK_THEME_NAME = 'vs-dark' ;
@@ -193,7 +194,9 @@ export class StandaloneThemeServiceImpl extends Disposable implements IStandalon
193194
194195 private readonly _environment : IEnvironmentService = Object . create ( null ) ;
195196 private readonly _knownThemes : Map < string , StandaloneTheme > ;
196- private _css : string ;
197+ private _codiconCSS : string ;
198+ private _themeCSS : string ;
199+ private _allCSS : string ;
197200 private _globalStyleElement : HTMLStyleElement | null ;
198201 private _styleElements : HTMLStyleElement [ ] ;
199202 private _theme ! : IStandaloneTheme ;
@@ -205,10 +208,17 @@ export class StandaloneThemeServiceImpl extends Disposable implements IStandalon
205208 this . _knownThemes . set ( VS_THEME_NAME , newBuiltInTheme ( VS_THEME_NAME ) ) ;
206209 this . _knownThemes . set ( VS_DARK_THEME_NAME , newBuiltInTheme ( VS_DARK_THEME_NAME ) ) ;
207210 this . _knownThemes . set ( HC_BLACK_THEME_NAME , newBuiltInTheme ( HC_BLACK_THEME_NAME ) ) ;
208- this . _css = '' ;
211+ this . _codiconCSS = CodiconStyles . getCSS ( ) ;
212+ this . _themeCSS = '' ;
213+ this . _allCSS = `${ this . _codiconCSS } \n${ this . _themeCSS } ` ;
209214 this . _globalStyleElement = null ;
210215 this . _styleElements = [ ] ;
211216 this . setTheme ( VS_THEME_NAME ) ;
217+
218+ CodiconStyles . onDidChange ( ( ) => {
219+ this . _codiconCSS = CodiconStyles . getCSS ( ) ;
220+ this . _updateCSS ( ) ;
221+ } ) ;
212222 }
213223
214224 public registerEditorContainer ( domNode : HTMLElement ) : IDisposable {
@@ -222,7 +232,7 @@ export class StandaloneThemeServiceImpl extends Disposable implements IStandalon
222232 if ( ! this . _globalStyleElement ) {
223233 this . _globalStyleElement = dom . createStyleSheet ( ) ;
224234 this . _globalStyleElement . className = 'monaco-colors' ;
225- this . _globalStyleElement . innerHTML = this . _css ;
235+ this . _globalStyleElement . innerHTML = this . _allCSS ;
226236 this . _styleElements . push ( this . _globalStyleElement ) ;
227237 }
228238 return Disposable . None ;
@@ -231,7 +241,7 @@ export class StandaloneThemeServiceImpl extends Disposable implements IStandalon
231241 private _registerShadowDomContainer ( domNode : HTMLElement ) : IDisposable {
232242 const styleElement = dom . createStyleSheet ( domNode ) ;
233243 styleElement . className = 'monaco-colors' ;
234- styleElement . innerHTML = this . _css ;
244+ styleElement . innerHTML = this . _allCSS ;
235245 this . _styleElements . push ( styleElement ) ;
236246 return {
237247 dispose : ( ) => {
@@ -300,15 +310,20 @@ export class StandaloneThemeServiceImpl extends Disposable implements IStandalon
300310 let colorMap = tokenTheme . getColorMap ( ) ;
301311 ruleCollector . addRule ( generateTokensCSSForColorMap ( colorMap ) ) ;
302312
303- this . _css = cssRules . join ( '\n' ) ;
304- this . _styleElements . forEach ( styleElement => styleElement . innerHTML = this . _css ) ;
313+ this . _themeCSS = cssRules . join ( '\n' ) ;
314+ this . _updateCSS ( ) ;
305315
306316 TokenizationRegistry . setColorMap ( colorMap ) ;
307317 this . _onColorThemeChange . fire ( theme ) ;
308318
309319 return theme . id ;
310320 }
311321
322+ private _updateCSS ( ) : void {
323+ this . _allCSS = `${ this . _codiconCSS } \n${ this . _themeCSS } ` ;
324+ this . _styleElements . forEach ( styleElement => styleElement . innerHTML = this . _allCSS ) ;
325+ }
326+
312327 public getFileIconTheme ( ) : IFileIconTheme {
313328 return {
314329 hasFileIcons : false ,
0 commit comments