mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-02 23:52:22 +03:00
move the icon styles inline
This commit is contained in:
parent
2c80f889c1
commit
2bea5d3550
@ -144,29 +144,6 @@ textStyle =
|
||||
]
|
||||
|
||||
|
||||
iconStyle : Icon -> Style
|
||||
iconStyle icon =
|
||||
batch
|
||||
[ position relative
|
||||
, checkboxImageSelector
|
||||
[ property "background-image" "url(todo)"
|
||||
, backgroundRepeat noRepeat
|
||||
, backgroundSize (px 24)
|
||||
, property "content" "''"
|
||||
, position absolute
|
||||
, left zero
|
||||
, top (calc (pct 50) minus (px 12))
|
||||
, width (px 24)
|
||||
, height (px 24)
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
checkboxImageSelector : List Style -> Style
|
||||
checkboxImageSelector =
|
||||
before
|
||||
|
||||
|
||||
labelClass : IsSelected -> Html.Styled.Attribute msg
|
||||
labelClass isSelected =
|
||||
case isSelected of
|
||||
@ -296,7 +273,7 @@ viewEnabledLabel model labelView icon =
|
||||
, cursor pointer
|
||||
]
|
||||
]
|
||||
[ viewIcon icon
|
||||
[ viewIcon [] icon
|
||||
, labelView model.label
|
||||
]
|
||||
|
||||
@ -326,10 +303,9 @@ viewDisabledLabel model labelView icon =
|
||||
, textStyle
|
||||
, outline none
|
||||
, cursor auto
|
||||
, checkboxImageSelector [ opacity (num 0.4) ]
|
||||
]
|
||||
]
|
||||
[ viewIcon icon
|
||||
[ viewIcon [ opacity (num 0.4) ] icon
|
||||
, labelView model.label
|
||||
]
|
||||
|
||||
@ -339,9 +315,20 @@ viewLabelContent label =
|
||||
Html.span [] [ Html.text label ]
|
||||
|
||||
|
||||
viewIcon : Icon -> Html.Html msg
|
||||
viewIcon (Icon icon) =
|
||||
Html.map never icon
|
||||
viewIcon : List Style -> Icon -> Html.Html msg
|
||||
viewIcon styles (Icon icon) =
|
||||
Html.div
|
||||
[ css
|
||||
[ position relative
|
||||
, left zero
|
||||
, top (calc (pct 50) minus (px 12))
|
||||
, width (px 24)
|
||||
, height (px 24)
|
||||
, Css.batch styles
|
||||
]
|
||||
]
|
||||
[ Html.map never icon
|
||||
]
|
||||
|
||||
|
||||
type Icon
|
||||
|
Loading…
Reference in New Issue
Block a user