@@ -83,8 +83,7 @@ module Internal.Model exposing
83 , reduceRecursive
83 , reduceRecursive
84 , reduceStyles
84 , reduceStyles
85 , reduceStylesRecursive
85 , reduceStylesRecursive
86− , removeNever
86+ , removeNever
88 -- , renderFont
87 -- , renderFont
90 , renderFontClassName
89 , renderFontClassName
@@ -537,7 +536,7 @@ embedWith static opts styles children =
537 if static then
536 if static then
538 staticRoot
537 staticRoot
539 :: (styles
538 :: (styles
540− |> List.foldl reduceStyles ( Set.empty, [ renderFocusStyle opts.focus ] )
539+ |> List.foldl reduceStyles ( Set.empty, renderFocusStyle opts.focus )
541 |> Tuple.second
540 |> Tuple.second
542 -- |> reduceStylesRecursive Set.empty [ ]) --renderFocusStyle opts.focus ]
541 -- |> reduceStylesRecursive Set.empty [ ]) --renderFocusStyle opts.focus ]
543 -- |> sortedReduce
542 -- |> sortedReduce
@@ -547,7 +546,7 @@ embedWith static opts styles children =
550− |> List.foldl reduceStyles ( Set.empty, [ renderFocusStyle opts.focus ] )
549+ |> List.foldl reduceStyles ( Set.empty, renderFocusStyle opts.focus )
551 |> Tuple.second
550 |> Tuple.second
552 -- |> reduceStylesRecursive Set.empty [ ]) --renderFocusStyle opts.focus ]
551 -- |> reduceStylesRecursive Set.empty [ ]) --renderFocusStyle opts.focus ]
553 -- |> sortedReduce
552 -- |> sortedReduce
@@ -561,7 +560,7 @@ embedKeyed static opts styles children =
561 ( "static-stylesheet", staticRoot )
560 ( "static-stylesheet", staticRoot )
562 :: ( "dynamic-stylesheet"
561 :: ( "dynamic-stylesheet"
564− |> List.foldl reduceStyles ( Set.empty, [ renderFocusStyle opts.focus ] )
563+ |> List.foldl reduceStyles ( Set.empty, renderFocusStyle opts.focus )
565 |> Tuple.second
564 |> Tuple.second
566 -- |> reduceStylesRecursive Set.empty [ ]) --renderFocusStyle opts.focus ]
565 -- |> reduceStylesRecursive Set.empty [ ]) --renderFocusStyle opts.focus ]
567 -- |> sortedReduce
566 -- |> sortedReduce
@@ -572,7 +571,7 @@ embedKeyed static opts styles children =
573 ( "dynamic-stylesheet"
572 ( "dynamic-stylesheet"
575− |> List.foldl reduceStyles ( Set.empty, [ renderFocusStyle opts.focus ] )
574+ |> List.foldl reduceStyles ( Set.empty, renderFocusStyle opts.focus )
576 |> Tuple.second
575 |> Tuple.second
577 -- |> reduceStylesRecursive Set.empty [ ]) --renderFocusStyle opts.focus ]
576 -- |> reduceStylesRecursive Set.empty [ ]) --renderFocusStyle opts.focus ]
578 -- |> sortedReduce
577 -- |> sortedReduce
@@ -2206,9 +2205,32 @@ renderFontClassName font current =
2207renderFocusStyle :
2206renderFocusStyle :
2208 FocusStyle
2207 FocusStyle
2209− -> Style
2208+ -> List Style
2210renderFocusStyle focus =
2209renderFocusStyle focus =
2210+ [ Style (Internal.Style.dot classes.focusedWithin ++ ":focus-within")
2211+ (List.filterMap identity
2212+ [ Maybe.map (\color -> Property "border-color" (formatColor color)) focus.borderColor
2213+ , Maybe.map (\color -> Property "background-color" (formatColor color)) focus.backgroundColor
2216+ Property "box-shadow"
2218+ { color = shadow.color
2221+ |> Tuple.mapFirst toFloat
2222+ |> Tuple.mapSecond toFloat
2224+ , blur = toFloat shadow.blur
2225+ , size = toFloat shadow.size
2230+ , Just <| Property "outline" "none"
2211− Style (Internal.Style.dot classes.any ++ ":focus .focusable, " ++ Internal.Style.dot classes.any ++ ".focusable:focus")
2233+ , Style (Internal.Style.dot classes.any ++ ":focus .focusable, " ++ Internal.Style.dot classes.any ++ ".focusable:focus")
2212 (List.filterMap identity
2234 (List.filterMap identity
2213 [ Maybe.map (\color -> Property "border-color" (formatColor color)) focus.borderColor
2235 [ Maybe.map (\color -> Property "border-color" (formatColor color)) focus.borderColor
2214 , Maybe.map (\color -> Property "background-color" (formatColor color)) focus.backgroundColor
2236 , Maybe.map (\color -> Property "background-color" (formatColor color)) focus.backgroundColor
@@ -2231,6 +2253,7 @@ renderFocusStyle focus =
2231 , Just <| Property "outline" "none"
2253 , Just <| Property "outline" "none"
2236focusDefaultStyle : { backgroundColor : Maybe Color, borderColor : Maybe Color, shadow : Maybe Shadow }
2259focusDefaultStyle : { backgroundColor : Maybe Color, borderColor : Maybe Color, shadow : Maybe Shadow }