From 3e57b70b4b5dddb26ca02f52a76129a2b8d4a14a Mon Sep 17 00:00:00 2001 From: cchaos Date: Fri, 21 Feb 2020 13:39:22 -0500 Subject: [PATCH] Update some more downstream components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Only showing the Amsterdam callout when they’ve switched to the Amsterdam theme - Added `makeGraphicColor()` SASS color function - Added defaults to `makeHighContrastColor()` SASS color function --- .../guide_rule/_guide_rule_example.scss | 2 +- src-docs/src/views/guidelines/colors.js | 46 ++++++++++++------- .../_notification_badge.scss | 11 +++-- src/components/expression/_variables.scss | 2 +- src/components/icon/_icon.scss | 2 +- src/components/icon/_variables.scss | 15 +++--- src/components/toast/_toast.scss | 12 ++--- src/global_styling/functions/_colors.scss | 11 ++++- src/global_styling/variables/_colors.scss | 12 ++--- 9 files changed, 68 insertions(+), 45 deletions(-) diff --git a/src-docs/src/components/guide_rule/_guide_rule_example.scss b/src-docs/src/components/guide_rule/_guide_rule_example.scss index 3d381d924204..22971f481bbe 100644 --- a/src-docs/src/components/guide_rule/_guide_rule_example.scss +++ b/src-docs/src/components/guide_rule/_guide_rule_example.scss @@ -32,7 +32,7 @@ } .guideRule__caption { - color: $euiColorSuccess; + color: $euiColorSuccessText; } } diff --git a/src-docs/src/views/guidelines/colors.js b/src-docs/src/views/guidelines/colors.js index fc4f7e31ff54..6f40d3eac405 100644 --- a/src-docs/src/views/guidelines/colors.js +++ b/src-docs/src/views/guidelines/colors.js @@ -24,6 +24,7 @@ import { EuiFormRow, EuiCode, EuiSwitch, + EuiCallOut, } from '../../../../src/components'; const allowedColors = [ @@ -156,14 +157,19 @@ export default class extends Component { const { selectedTheme } = this.props; let palette; - if (selectedTheme === 'amsterdam-dark') { - palette = darkAmsterdamColors; - } else if (selectedTheme === 'amsterdam-light') { - palette = { ...lightColors, ...lightAmsterdamColors }; - } else if (selectedTheme === 'dark') { - palette = darkColors; - } else { - palette = lightColors; + switch (selectedTheme) { + case 'amsterdam-dark': + palette = darkAmsterdamColors; + break; + case 'amsterdam-light': + palette = { ...lightColors, ...lightAmsterdamColors }; + break; + case 'dark': + palette = darkColors; + break; + default: + palette = lightColors; + break; } // Vis colors are the same for all palettes @@ -238,14 +244,22 @@ export default class extends Component { combination that is AA or above with the exception of using large text.

-

- The Amsterdam theme introduces a more vibrant core color palette. In - order to maintain a WCAG contrast of at least 4.5 you should use the - text variants of the core color variables such as  - $euiColorSecondaryText. Components that render - text such as EuiText will do so on their own - without any extra configuration. -

+ {selectedTheme === 'amsterdam-light' && ( + +

+ The Amsterdam theme introduces a more vibrant core color + palette. In order to maintain a WCAG contrast of at least 4.5 + you should use the text variants of the core color variables + such as  + $euiColorSecondaryText. Components that + render text such as EuiText will do so on + their own without any extra configuration. +

+
+ )}

Rating definitions