Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Fechner authored and Florian Fechner committed Jul 26, 2020
1 parent f4678aa commit c15cf23
Showing 1 changed file with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,27 @@ class SettingsDialog extends Polymer.mixinBehaviors([Polymer.AppLocalizeBehavior

this.shadowRoot.querySelector('.display-selection').addEventListener('selected-changed', () =>
{
if(this.display == 'light')
{
document.documentElement.style.setProperty('--primary-color', '#888');
document.documentElement.style.setProperty('--secondary-color', '#000');
document.documentElement.style.setProperty('--background-color', '#fff');
}

if(this.display == 'dark')
{
document.documentElement.style.setProperty('--primary-color', '#eee');
document.documentElement.style.setProperty('--secondary-color', '#fff');
document.documentElement.style.setProperty('--background-color', '#333');
}
updateCSSVariables();
});

updateCSSVariables();
}

updateCSSVariables()
{
if(this.display == 'light')
{
document.documentElement.style.setProperty('--primary-color', '#888');
document.documentElement.style.setProperty('--secondary-color', '#000');
document.documentElement.style.setProperty('--background-color', '#fff');
}

if(this.display == 'dark')
{
document.documentElement.style.setProperty('--primary-color', '#eee');
document.documentElement.style.setProperty('--secondary-color', '#fff');
document.documentElement.style.setProperty('--background-color', '#333');
}
}

open()
Expand Down

0 comments on commit c15cf23

Please sign in to comment.