Skip to content

Commit

Permalink
Improve Dark Theme with Accent Background color scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
krlvm committed Aug 2, 2021
1 parent b998c97 commit 9c43f79
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions BeautySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const layeredColor = (color) => {
}

const FLUENT_NOISE_TEXTURE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA5OSURBVGhDfdlXq9VcFwXgnB1L7L333hsiKipY0BsFQUQU77zw7/jPBHvvvfd2bN9+5suQg8gXCEnWmmXMMcdaydln4MyZMxM/f/7cvH37tpk4cWLz/v37Zvr06fU8c+bM5ubNm83KlSubly9fNuxcx44dW+eIESOax48fN4sXL27u37/fjB49uvw3btzYXL58uWxmz55d9+bEXLt2bXP37t2KNXXq1ObXr1915dfr9ZrXr183c+fOLfuvX79WDrGHDRtWz2yCc/z48eUPZ3vkyJFucHCwAvz48aNZsGBBOTh//vxZTk+ePKlkgs+ZM6fuv3//XuOjRo0qwLNmzWqePXtW458+fWpGjhzZTJs2rWI8f/685ufNm1c+ipNv3LhxdQJ07dq1KgBRcj969KjwsBNzYGCgQI8ZM6b5/ft38+XLl7p/+vRp8+HDh6bdvn17h6F169ZVUImvX79eXXnx4kXTtm0FwCZwrhiSbMaMGWWDEc/Ymz9/fjNp0qQCkY7xUxwCXOV49+5dAb93714VigyAly1b1ty5c6e67NmhcDnEmjJlSuFxwoZIBLUbNmzosHz79u2qbPjw4cXQt2/fqmKsCsDx1atXNQaoK5a6ritQfBWGFDEAVMybN2+ahQsXFovm+H38+LGSY1/HJ0yYUB0TDzH8dF8cQBUPNOXApnCk85UXvp7KTWALgzSYtQC8Z/rENECY0xW27LDlyg4Z7iVbv359zbFXLE0vX7684sopBh+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6cI7baGan/vjwHqU4QvEhSWziFAx+XDfCRtLSgOqWwVxY+9qzj85Na1+hXFQlOhScl8wPm3AVmkC9n7OTtIgQ8ADppWlEQOUiAPRUlEViQgNk0DAzR/oOW2y1mvciATKYAiLjud4vKa0GW+8rTHjh2rn4MCVjLvBy3lkE8V8pIYOw5JgMCe4jGnUDYOY06xnWKbU7zO6oYY2UZ1N2deB9aiohWJADJSFCnx964RQ9z24MGDnUHV0bRK+5/2FYABlgI47wC22AHKb1ORCxlKZC2Y0x0A2MpBwuIjRaeQZ1xc4HyEAu+ZHQwUIT8CqUCBCBKTvJEtX/0PUUCnhWmSEWOSECCyIx0MSA6Ig/4lSkKJLE4LE2DdsAvSuMPO6J0jHxusiq8TOuO9AhgpAi4uuek2tdipdN+VBBXMr4dhA65AYsaBFeNY1H7j5oECRLcUys9fbuwjQ38E+WZjAzBfX6+uxhDhzCaR7suDSHaKAF5hQGeblk9x8rGxCSmwlw9BBgI6OGixQwCadbX4JSMz9hKkcDHEAsiBBHPA8nWv45KKbQxJroqyY5GsQx4YEIc08woWm78OOSxyJHquXxoZCkIutknOKhZI212B18LsbJ51R/HWhwIxZc2IBSC5iHXu3LkCwM+6sdMAZk3ZBEjZWvJuYRNJIYuNd09e1uJEOebEqT/MDPjbmCPmTfzNojc3cE4FGkvbBWZLOlgkDZ3REc9syQuogHA1H/n6mwaZ5uQWQ9ecyekeKYq03tiZi+x6jCRMexXi3qEwjAuSonQCMG0WyLgxwQQ1DjRbHRNLUkTxYwe8/8nIZZws+cqFVJjEEVfRwDv5sDPmNA/z4OBg8z9ueiVWZxOyPgAAAABJRU5ErkJggg==';
const ACCENT_BACKGROUND_CLASS_NAME = 'bsAccentBackground';
const DARK_THEME_CLASS_NAME = 'bsDark', DARK_THEME_CLASS = '.' + DARK_THEME_CLASS_NAME;
const injectDarkTheme = (parent = '') => {
injectStyle(`
Expand Down Expand Up @@ -211,12 +212,21 @@ const injectDarkTheme = (parent = '') => {
background-color: rgba(255, 255, 255, 0.3) !important;
}
${parent} .suggestions .selectable:not(.sa_hv):hover, ${parent} .suggestions .previewPaneOpened:not(.sa_hv) {
${parent} .suggestions .selectable:not(.sa_hv):hover,
${parent} .suggestions .previewPaneOpened:not(.sa_hv) {
background-color: rgba(255, 255, 255, 0.1) !important;
}
${parent} .suggestions .selectable:not(.sa_hv):active {
background-color: rgba(255, 255, 255, 0.25) !important;
}
.${ACCENT_BACKGROUND_CLASS_NAME} ${parent} .suggestions .selectable:not(.sa_hv):hover,
.${ACCENT_BACKGROUND_CLASS_NAME} ${parent} .suggestions .previewPaneOpened:not(.sa_hv) {
background-color: rgba(255, 255, 255, 0.2) !important;
}
.${ACCENT_BACKGROUND_CLASS_NAME} ${parent} .suggestions .selectable:not(.sa_hv):active {
background-color: rgba(255, 255, 255, 0.3) !important;
}
`);
}

Expand Down Expand Up @@ -418,13 +428,13 @@ if(SETTINGS.backgroundMode) {

if(isSystemLightTheme()) {
root.style.backgroundColor = null;
root.classList.remove('bsAccentBackground');
root.classList.remove(ACCENT_BACKGROUND_CLASS_NAME);
if(SETTINGS.acrylicMode == 'fake') {
applyFakeAcrylic();
}
} else {
let color = '#' + CortanaApp.themeColors.accentDark1.substr(3);
root.classList.add('bsAccentBackground');
root.classList.add(ACCENT_BACKGROUND_CLASS_NAME);

if(SETTINGS.acrylicMode == 'fake') {
applyFakeAcrylic(hexToRGBA(color, 0.84));
Expand Down

0 comments on commit 9c43f79

Please sign in to comment.