From 534fade431994c1cea4d53a8442e71250433dab6 Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Wed, 20 Jun 2018 10:52:02 -0700 Subject: [PATCH] Kill the color theme --- src/Nri/Ui/Checkbox/V3.elm | 27 ++++++--------------------- src/Nri/Ui/PremiumCheckbox/V1.elm | 2 +- styleguide-app/Examples/Checkbox.elm | 6 +++--- styleguide-app/Examples/TextArea.elm | 6 +++--- 4 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/Nri/Ui/Checkbox/V3.elm b/src/Nri/Ui/Checkbox/V3.elm index 1e546654..67ab1854 100644 --- a/src/Nri/Ui/Checkbox/V3.elm +++ b/src/Nri/Ui/Checkbox/V3.elm @@ -1,7 +1,6 @@ module Nri.Ui.Checkbox.V3 exposing - ( ColorTheme(..) - , IsSelected(..) + ( IsSelected(..) , Model , Theme(..) , view @@ -10,7 +9,7 @@ module Nri.Ui.Checkbox.V3 {-| -@docs Model, Theme, ColorTheme, IsSelected +@docs Model, Theme, IsSelected @docs view, viewWithLabel @@ -62,17 +61,11 @@ type IsSelected {-| -} type Theme - = Square ColorTheme + = Square | LockOnInside | Premium -{-| -} -type ColorTheme - = Default - | Gray - - selectedToMaybe : IsSelected -> Maybe Bool selectedToMaybe selected = case selected of @@ -111,9 +104,9 @@ buildCheckbox assets modifierClasses model labelContent = in viewCheckbox model <| case model.theme of - Square colorTheme -> + Square -> { containerClasses = toClassList (modifierClasses ++ [ "SquareClass" ]) - , labelStyles = squareLabelStyles assets model colorTheme + , labelStyles = squareLabelStyles assets model , labelClasses = labelClass model.selected , labelContent = labelContent } @@ -133,7 +126,7 @@ buildCheckbox assets modifierClasses model labelContent = } -squareLabelStyles assets model colorTheme = +squareLabelStyles assets model = let baseStyles = [ -- Postioning @@ -145,14 +138,6 @@ squareLabelStyles assets model colorTheme = -- Text , Fonts.baseFont , fontSize (px 16) - , Css.batch <| - -- If this is the only difference, is it worth having a color theme at all?? - case colorTheme of - Gray -> - [ color Colors.gray45 ] - - Default -> - [ color Colors.gray20 ] -- Focus & Hover , outline none diff --git a/src/Nri/Ui/PremiumCheckbox/V1.elm b/src/Nri/Ui/PremiumCheckbox/V1.elm index 8ff3de08..84ed6f55 100644 --- a/src/Nri/Ui/PremiumCheckbox/V1.elm +++ b/src/Nri/Ui/PremiumCheckbox/V1.elm @@ -56,7 +56,7 @@ premium assets config = else if config.contentPremiumLevel /= Free then Checkbox.Premium else - Checkbox.Square Checkbox.Default + Checkbox.Square in Html.div [ css diff --git a/styleguide-app/Examples/Checkbox.elm b/styleguide-app/Examples/Checkbox.elm index acb942ec..82abb4b1 100644 --- a/styleguide-app/Examples/Checkbox.elm +++ b/styleguide-app/Examples/Checkbox.elm @@ -108,7 +108,7 @@ viewInteractableCheckbox id state = , setterMsg = ToggleCheck id , selected = isSelected id state , disabled = False - , theme = Checkbox.Square Checkbox.Default + , theme = Checkbox.Square , noOpMsg = NoOp } @@ -122,7 +122,7 @@ viewIndeterminateCheckbox id state = , setterMsg = ToggleCheck id , selected = Checkbox.PartiallySelected , disabled = True - , theme = Checkbox.Square Checkbox.Default + , theme = Checkbox.Square , noOpMsg = NoOp } @@ -150,7 +150,7 @@ viewDisabledCheckbox id state = , setterMsg = ToggleCheck id , selected = isSelected id state , disabled = True - , theme = Checkbox.Square Checkbox.Default + , theme = Checkbox.Square , noOpMsg = NoOp } diff --git a/styleguide-app/Examples/TextArea.elm b/styleguide-app/Examples/TextArea.elm index b1184db5..58c20af5 100644 --- a/styleguide-app/Examples/TextArea.elm +++ b/styleguide-app/Examples/TextArea.elm @@ -49,7 +49,7 @@ example parentMessage state = , setterMsg = ToggleLabel , selected = state.showLabel , disabled = False - , theme = Checkbox.Square Checkbox.Default + , theme = Checkbox.Square , noOpMsg = NoOp } |> Html.Styled.toUnstyled @@ -59,7 +59,7 @@ example parentMessage state = , setterMsg = ToggleAutoResize , selected = state.autoResize , disabled = False - , theme = Checkbox.Square Checkbox.Default + , theme = Checkbox.Square , noOpMsg = NoOp } |> Html.Styled.toUnstyled @@ -69,7 +69,7 @@ example parentMessage state = , setterMsg = ToggleErrorState , selected = state.isInError , disabled = False - , theme = Checkbox.Square Checkbox.Default + , theme = Checkbox.Square , noOpMsg = NoOp } |> Html.Styled.toUnstyled