Opacify just the checkbox image and not the whole line

This commit is contained in:
Tessa Kelly 2018-06-25 17:48:23 -07:00
parent 84a26bff31
commit abef87447e

View File

@ -138,10 +138,12 @@ squareLabelStyles model image =
] ]
in in
css css
(if model.disabled then (baseStyles
[ cursor auto, opacity (num 0.4) ] ++ baseStyles ++ (if model.disabled then
else [ cursor auto, checkboxImageSelector [ opacity (num 0.4) ] ]
[ cursor pointer ] ++ baseStyles else
[ cursor pointer ]
)
) )
@ -156,10 +158,14 @@ lockLabelStyles model image =
] ]
in in
css css
(if model.disabled then (baseStyles
[ cursor auto, opacity (num 0.4) ] ++ baseStyles ++ (if model.disabled then
else [ cursor auto
[ cursor pointer ] ++ baseStyles , checkboxImageSelector [ opacity (num 0.4) ]
]
else
[ cursor pointer ]
)
) )
@ -183,7 +189,7 @@ addIcon : Asset -> Style
addIcon icon = addIcon icon =
batch batch
[ position relative [ position relative
, before , checkboxImageSelector
[ backgroundImage icon [ backgroundImage icon
, backgroundRepeat noRepeat , backgroundRepeat noRepeat
, backgroundSize (px 24) , backgroundSize (px 24)
@ -197,6 +203,11 @@ addIcon icon =
] ]
checkboxImageSelector : List Style -> Style
checkboxImageSelector =
before
labelClass : IsSelected -> Html.Styled.Attribute msg labelClass : IsSelected -> Html.Styled.Attribute msg
labelClass isSelected = labelClass isSelected =
case isSelected of case isSelected of