mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-06 15:23:38 +03:00
Reverse the loading order of themes.
We want the first/top-most theme's css to be loaded after the others so its styles will override styles in the other themes.
This commit is contained in:
parent
37c10af4de
commit
1ba04cb58a
@ -39,8 +39,8 @@ describe "ThemeManager", ->
|
||||
|
||||
config.set('core.themes', ['atom-light-syntax', 'atom-dark-syntax'])
|
||||
expect($('style.theme').length).toBe 2
|
||||
expect($('style.theme:eq(0)').attr('id')).toMatch /atom-light-syntax/
|
||||
expect($('style.theme:eq(1)').attr('id')).toMatch /atom-dark-syntax/
|
||||
expect($('style.theme:eq(0)').attr('id')).toMatch /atom-dark-syntax/
|
||||
expect($('style.theme:eq(1)').attr('id')).toMatch /atom-light-syntax/
|
||||
|
||||
config.set('core.themes', [])
|
||||
expect($('style.theme').length).toBe 0
|
||||
|
@ -39,6 +39,11 @@ class ThemeManager
|
||||
config.observe 'core.themes', (themeNames) =>
|
||||
@unload()
|
||||
themeNames = [themeNames] unless _.isArray(themeNames)
|
||||
|
||||
# Reverse so the first (top) theme is loaded after the others. We want
|
||||
# the first/top theme to override later themes in the stack.
|
||||
(themeNames = _.clone(themeNames)).reverse()
|
||||
|
||||
@activateTheme(themeName) for themeName in themeNames
|
||||
@loadUserStylesheet()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user