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
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

View File

@ -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

View File

@ -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
}

View File

@ -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