From e7fe2dc9f9e52771c2ffe8d0ee1c4e8b2e38ab2f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 14 Nov 2018 19:39:17 +0300 Subject: [PATCH] collateral fixes, removed alpha control for alerts, added contrast text generation for alerts, updated getTextColor to also have fallback to black/white if resulting contrast isn't passable (only when inverting lightness!), updated UI to use tabs. --- src/App.js | 7 +- src/App.scss | 9 +- .../contrast_ratio/contrast_ratio.vue | 4 +- .../delete_button/delete_button.vue | 2 +- .../notifications/notifications.scss | 10 +- .../style_switcher/style_switcher.js | 40 +-- .../style_switcher/style_switcher.vue | 257 +++++++++--------- src/components/timeline/timeline.vue | 5 - src/services/color_convert/color_convert.js | 23 +- src/services/style_setter/style_setter.js | 28 +- .../user_highlighter/user_highlighter.js | 2 +- 11 files changed, 200 insertions(+), 187 deletions(-) diff --git a/src/App.js b/src/App.js index 05e3eda3..b06e8b5d 100644 --- a/src/App.js +++ b/src/App.js @@ -59,7 +59,12 @@ export default { }) }, logo () { return this.$store.state.instance.logo }, - style () { return { 'background-image': `url(${this.background})` } }, + style () { + return { + '--body-background-image': `url(${this.background})`, + 'background-image': `url(${this.background})` + } + }, sitename () { return this.$store.state.instance.name }, chat () { return this.$store.state.chat.channel.state === 'joined' }, suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled }, diff --git a/src/App.scss b/src/App.scss index 0a2ff5cc..8fb3c488 100644 --- a/src/App.scss +++ b/src/App.scss @@ -473,14 +473,19 @@ nav { padding: 0.25em; border-radius: $fallback--tooltipRadius; border-radius: var(--tooltipRadius, $fallback--tooltipRadius); - color: $fallback--faint; - color: var(--faint, $fallback--faint); min-height: 28px; line-height: 28px; &.error { background-color: $fallback--alertError; background-color: var(--alertError, $fallback--alertError); + color: $fallback--text; + color: var(--alertErrorText, $fallback--text); + + .panel-heading & { + color: $fallback--text; + color: var(--alertErrorPanelText, $fallback--text); + } } } diff --git a/src/components/contrast_ratio/contrast_ratio.vue b/src/components/contrast_ratio/contrast_ratio.vue index a428e75f..cb65c371 100644 --- a/src/components/contrast_ratio/contrast_ratio.vue +++ b/src/components/contrast_ratio/contrast_ratio.vue @@ -1,5 +1,5 @@