Kill the color theme

This commit is contained in:
Tessa Kelly 2018-06-20 10:52:02 -07:00
parent 7c64660549
commit 534fade431
4 changed files with 13 additions and 28 deletions

View File

@ -1,7 +1,6 @@
module Nri.Ui.Checkbox.V3 module Nri.Ui.Checkbox.V3
exposing exposing
( ColorTheme(..) ( IsSelected(..)
, IsSelected(..)
, Model , Model
, Theme(..) , Theme(..)
, view , view
@ -10,7 +9,7 @@ module Nri.Ui.Checkbox.V3
{-| {-|
@docs Model, Theme, ColorTheme, IsSelected @docs Model, Theme, IsSelected
@docs view, viewWithLabel @docs view, viewWithLabel
@ -62,17 +61,11 @@ type IsSelected
{-| -} {-| -}
type Theme type Theme
= Square ColorTheme = Square
| LockOnInside | LockOnInside
| Premium | Premium
{-| -}
type ColorTheme
= Default
| Gray
selectedToMaybe : IsSelected -> Maybe Bool selectedToMaybe : IsSelected -> Maybe Bool
selectedToMaybe selected = selectedToMaybe selected =
case selected of case selected of
@ -111,9 +104,9 @@ buildCheckbox assets modifierClasses model labelContent =
in in
viewCheckbox model <| viewCheckbox model <|
case model.theme of case model.theme of
Square colorTheme -> Square ->
{ containerClasses = toClassList (modifierClasses ++ [ "SquareClass" ]) { containerClasses = toClassList (modifierClasses ++ [ "SquareClass" ])
, labelStyles = squareLabelStyles assets model colorTheme , labelStyles = squareLabelStyles assets model
, labelClasses = labelClass model.selected , labelClasses = labelClass model.selected
, labelContent = labelContent , labelContent = labelContent
} }
@ -133,7 +126,7 @@ buildCheckbox assets modifierClasses model labelContent =
} }
squareLabelStyles assets model colorTheme = squareLabelStyles assets model =
let let
baseStyles = baseStyles =
[ -- Postioning [ -- Postioning
@ -145,14 +138,6 @@ squareLabelStyles assets model colorTheme =
-- Text -- Text
, Fonts.baseFont , Fonts.baseFont
, fontSize (px 16) , 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 -- Focus & Hover
, outline none , outline none

View File

@ -56,7 +56,7 @@ premium assets config =
else if config.contentPremiumLevel /= Free then else if config.contentPremiumLevel /= Free then
Checkbox.Premium Checkbox.Premium
else else
Checkbox.Square Checkbox.Default Checkbox.Square
in in
Html.div Html.div
[ css [ css

View File

@ -108,7 +108,7 @@ viewInteractableCheckbox id state =
, setterMsg = ToggleCheck id , setterMsg = ToggleCheck id
, selected = isSelected id state , selected = isSelected id state
, disabled = False , disabled = False
, theme = Checkbox.Square Checkbox.Default , theme = Checkbox.Square
, noOpMsg = NoOp , noOpMsg = NoOp
} }
@ -122,7 +122,7 @@ viewIndeterminateCheckbox id state =
, setterMsg = ToggleCheck id , setterMsg = ToggleCheck id
, selected = Checkbox.PartiallySelected , selected = Checkbox.PartiallySelected
, disabled = True , disabled = True
, theme = Checkbox.Square Checkbox.Default , theme = Checkbox.Square
, noOpMsg = NoOp , noOpMsg = NoOp
} }
@ -150,7 +150,7 @@ viewDisabledCheckbox id state =
, setterMsg = ToggleCheck id , setterMsg = ToggleCheck id
, selected = isSelected id state , selected = isSelected id state
, disabled = True , disabled = True
, theme = Checkbox.Square Checkbox.Default , theme = Checkbox.Square
, noOpMsg = NoOp , noOpMsg = NoOp
} }

View File

@ -49,7 +49,7 @@ example parentMessage state =
, setterMsg = ToggleLabel , setterMsg = ToggleLabel
, selected = state.showLabel , selected = state.showLabel
, disabled = False , disabled = False
, theme = Checkbox.Square Checkbox.Default , theme = Checkbox.Square
, noOpMsg = NoOp , noOpMsg = NoOp
} }
|> Html.Styled.toUnstyled |> Html.Styled.toUnstyled
@ -59,7 +59,7 @@ example parentMessage state =
, setterMsg = ToggleAutoResize , setterMsg = ToggleAutoResize
, selected = state.autoResize , selected = state.autoResize
, disabled = False , disabled = False
, theme = Checkbox.Square Checkbox.Default , theme = Checkbox.Square
, noOpMsg = NoOp , noOpMsg = NoOp
} }
|> Html.Styled.toUnstyled |> Html.Styled.toUnstyled
@ -69,7 +69,7 @@ example parentMessage state =
, setterMsg = ToggleErrorState , setterMsg = ToggleErrorState
, selected = state.isInError , selected = state.isInError
, disabled = False , disabled = False
, theme = Checkbox.Square Checkbox.Default , theme = Checkbox.Square
, noOpMsg = NoOp , noOpMsg = NoOp
} }
|> Html.Styled.toUnstyled |> Html.Styled.toUnstyled