From 7d7ccf729855283ad0f5b9d6943b8d86ed1f180d Mon Sep 17 00:00:00 2001 From: Henry Jameson <me@hjkos.com> Date: Sun, 19 Jan 2020 22:44:35 +0200 Subject: [PATCH] fix some contrast ratios not displaying --- .../contrast_ratio/contrast_ratio.vue | 12 +++++++++--- .../style_switcher/style_switcher.vue | 18 +++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/components/contrast_ratio/contrast_ratio.vue b/src/components/contrast_ratio/contrast_ratio.vue index 15a450a2..5e79ef41 100644 --- a/src/components/contrast_ratio/contrast_ratio.vue +++ b/src/components/contrast_ratio/contrast_ratio.vue @@ -37,9 +37,15 @@ <script> export default { - props: [ - 'large', 'contrast' - ], + props: { + large: { + required: false + }, + contrast: { + required: true, + type: Object + } + }, computed: { hint () { const levelVal = this.contrast.aaa ? 'aaa' : (this.contrast.aa ? 'aa' : 'bad') diff --git a/src/components/style_switcher/style_switcher.vue b/src/components/style_switcher/style_switcher.vue index e3b899f0..c8c02b8d 100644 --- a/src/components/style_switcher/style_switcher.vue +++ b/src/components/style_switcher/style_switcher.vue @@ -157,13 +157,13 @@ name="cRedColor" :label="$t('settings.cRed')" /> - <ContrastRatio :contrast="previewContrast.bgRed" /> + <ContrastRatio :contrast="previewContrast.bgCRed" /> <ColorInput v-model="cBlueColorLocal" name="cBlueColor" :label="$t('settings.cBlue')" /> - <ContrastRatio :contrast="previewContrast.bgBlue" /> + <ContrastRatio :contrast="previewContrast.bgCBlue" /> </div> <div class="color-item"> <ColorInput @@ -171,13 +171,13 @@ name="cGreenColor" :label="$t('settings.cGreen')" /> - <ContrastRatio :contrast="previewContrast.bgGreen" /> + <ContrastRatio :contrast="previewContrast.bgCGreen" /> <ColorInput v-model="cOrangeColorLocal" name="cOrangeColor" :label="$t('settings.cOrange')" /> - <ContrastRatio :contrast="previewContrast.bgOrange" /> + <ContrastRatio :contrast="previewContrast.bgCOrange" /> </div> <p>{{ $t('settings.theme_help_v2_2') }}</p> </div> @@ -217,7 +217,7 @@ /> <ContrastRatio :contrast="previewContrast.alertErrorText" - large="1" + large="true" /> <ColorInput v-model="alertWarningColorLocal" @@ -233,7 +233,7 @@ /> <ContrastRatio :contrast="previewContrast.alertWarningText" - large="1" + large="true" /> </div> <div class="color-item"> @@ -252,7 +252,7 @@ /> <ContrastRatio :contrast="previewContrast.badgeNotificationText" - large="1" + large="true" /> </div> <div class="color-item"> @@ -277,7 +277,7 @@ /> <ContrastRatio :contrast="previewContrast.panelText" - large="1" + large="true" /> <ColorInput v-model="panelLinkColorLocal" @@ -287,7 +287,7 @@ /> <ContrastRatio :contrast="previewContrast.panelLink" - large="1" + large="true" /> </div> <div class="color-item">