From 6b6f68ee8ce464addb76a0b6f513bacf6a5205e2 Mon Sep 17 00:00:00 2001 From: HiKaylum Date: Sun, 22 Dec 2019 15:41:33 +0000 Subject: [PATCH] fix(select): fixed select state styling select when `is-dark` can now have `is-error`, `is-success` and `is-warning` #384 --- scss/form/selects.scss | 5 ++--- story/select/select.template.js | 15 +++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/scss/form/selects.scss b/scss/form/selects.scss index f6f3e7d7..4f5f5c14 100644 --- a/scss/form/selects.scss +++ b/scss/form/selects.scss @@ -47,11 +47,10 @@ // prettier-ignore $types: + "dark" map-get($default-colors, "normal") map-get($default-colors, "hover"), "success" map-get($success-colors, "normal") map-get($success-colors, "hover"), "warning" map-get($warning-colors, "normal") map-get($warning-colors, "hover"), - "error" map-get($error-colors, "normal") map-get($error-colors, "hover"), - "dark" map-get($default-colors, "normal") map-get($default-colors, "hover"); - + "error" map-get($error-colors, "normal") map-get($error-colors, "hover"); @each $type in $types { &.is-#{nth($type, 1)} { $color: nth($type, 2); diff --git a/story/select/select.template.js b/story/select/select.template.js index 81a66d29..e79c5335 100644 --- a/story/select/select.template.js +++ b/story/select/select.template.js @@ -1,16 +1,23 @@ -import { select } from '@storybook/addon-knobs'; +import { boolean, select } from '@storybook/addon-knobs'; +import classNames from 'classnames'; import sharedOptions from '../_helpers/shared'; export default () => { - const selectedClass = select('class', { + const isDark = boolean('is-dark', false); + const selectOptions = select('class', { default: '', ...sharedOptions, - 'is-dark': 'is-dark', }, ''); + const selectedClasses = classNames( + 'nes-select', + selectOptions, + { 'is-dark': isDark }, + ); + return ` -
+