Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement theme selector #48

Open
beefsack opened this issue May 19, 2015 · 0 comments
Open

Implement theme selector #48

beefsack opened this issue May 19, 2015 · 0 comments

Comments

@beefsack
Copy link
Member

Having custom themes would be cool. I'm currently using a hack for a dark theme, but it might work something like (completely untested):

<label><input type="checkbox" onchange="toggleDarkTheme($(this).is(':checked'));" id="themeToggle" /> dark theme</label>
function toggleDarkTheme(on) {
    $('#themeToggle').prop('checked', on);
    $(body).toggleClass('theme-dark', on);
    if (on) {
        localStorage.setItem('theme', 'dark');
    } else {
        localStorage.removeItem('theme');
    }
}
$(document).ready(function() {
    if (localStorage.getItem('theme') === 'dark') {
        toggleDarkTheme(true);
    }
});
body.theme-dark {
    color: white;
    background-color: #1d1f21;
}
body.theme-dark div.pure-menu.pure-menu-open {
    background-color: #1d1f21;
}
body.theme-dark #command {
    background-color: #1d1f21;
}
body.theme-dark [style="color:rgb(0,0,0);"] {
    color: white;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants