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