@@ -41,38 +41,81 @@ import Internal.Style as Style exposing (classes)
4141{-| -}
4242color : Color -> Attr decorative msg
4343color clr =
44− Internal.StyleClass Flag.borderColor (Internal.Colored ("border-color-" ++ Internal.formatColorClass clr) "border-color" clr)
44+ Internal.StyleClass
45+ Flag.borderColor
46+ (Internal.Colored
47+ ("bc-" ++ Internal.formatColorClass clr)
48+ "border-color"
49+ clr
50+ )
4551
4652
4753{-| -}
4854width : Int -> Attribute msg
4955width v =
50− Internal.StyleClass Flag.borderWidth (Internal.Single ("border-" ++ String.fromInt v) "border-width" (String.fromInt v ++ "px"))
56+ Internal.StyleClass
57+ Flag.borderWidth
58+ (Internal.BorderWidth
59+ ("b-" ++ String.fromInt v)
60+ v
61+ v
62+ v
63+ v
64+ )
5165
5266
5367{-| Set horizontal and vertical borders.
5468-}
5569widthXY : Int -> Int -> Attribute msg
5670widthXY x y =
57− Internal.StyleClass Flag.borderWidth (Internal.Single ("border-" ++ String.fromInt x ++ "-" ++ String.fromInt y) "border-width" (String.fromInt y ++ "px " ++ String.fromInt x ++ "px"))
71+ Internal.StyleClass
72+ Flag.borderWidth
73+ (Internal.BorderWidth
74+ ("b-"
75+ ++ String.fromInt x
76+ ++ "-"
77+ ++ String.fromInt y
78+ )
79+ y
80+ x
81+ y
82+ x
83+ )
5884
5985
6086{-| -}
61−widthEach : { bottom : Int, left : Int, right : Int, top : Int } -> Attribute msg
87+widthEach :
88+ { bottom : Int
89+ , left : Int
90+ , right : Int
91+ , top : Int
92+ }
93+ -> Attribute msg
6294widthEach { bottom, top, left, right } =
63− Internal.StyleClass Flag.borderWidth
64− (Internal.Single ("border-" ++ String.fromInt top ++ "-" ++ String.fromInt right ++ String.fromInt bottom ++ "-" ++ String.fromInt left)
65− "border-width"
66− (String.fromInt top
67− ++ "px "
68− ++ String.fromInt right
69− ++ "px "
70− ++ String.fromInt bottom
71− ++ "px "
72− ++ String.fromInt left
73− ++ "px"
95+ if top == bottom && left == right then
96+ if top == right then
97+ width top
98+
99+ else
100+ widthXY left top
101+
102+ else
103+ Internal.StyleClass Flag.borderWidth
104+ (Internal.BorderWidth
105+ ("b-"
106+ ++ String.fromInt top
107+ ++ "-"
108+ ++ String.fromInt right
109+ ++ "-"
110+ ++ String.fromInt bottom
111+ ++ "-"
112+ ++ String.fromInt left
113+ )
114+ top
115+ right
116+ bottom
117+ left
74118 )
75− )
76119
77120
78121
@@ -105,14 +148,34 @@ dotted =
105148-}
106149rounded : Int -> Attribute msg
107150rounded radius =
108− Internal.StyleClass Flag.borderRound (Internal.Single ("border-radius-" ++ String.fromInt radius) "border-radius" (String.fromInt radius ++ "px"))
151+ Internal.StyleClass
152+ Flag.borderRound
153+ (Internal.Single
154+ ("br-" ++ String.fromInt radius)
155+ "border-radius"
156+ (String.fromInt radius ++ "px")
157+ )
109158
110159
111160{-| -}
112−roundEach : { topLeft : Int, topRight : Int, bottomLeft : Int, bottomRight : Int } -> Attribute msg
161+roundEach :
162+ { topLeft : Int
163+ , topRight : Int
164+ , bottomLeft : Int
165+ , bottomRight : Int
166+ }
167+ -> Attribute msg
113168roundEach { topLeft, topRight, bottomLeft, bottomRight } =
114169 Internal.StyleClass Flag.borderRound
115− (Internal.Single ("border-radius-" ++ String.fromInt topLeft ++ "-" ++ String.fromInt topRight ++ String.fromInt bottomLeft ++ "-" ++ String.fromInt bottomRight)
170+ (Internal.Single
171+ ("br-"
172+ ++ String.fromInt topLeft
173+ ++ "-"
174+ ++ String.fromInt topRight
175+ ++ String.fromInt bottomLeft
176+ ++ "-"
177+ ++ String.fromInt bottomRight
178+ )
116179 "border-radius"
117180 (String.fromInt topLeft
118181 ++ "px "
@@ -168,7 +231,10 @@ shadow almostShade =
168231 }
169232 in
170233 Internal.StyleClass Flag.shadows <|
171− Internal.Single (Internal.boxShadowName shade) "box-shadow" (Internal.formatBoxShadow shade)
234+ Internal.Single
235+ (Internal.boxShadowName shade)
236+ "box-shadow"
237+ (Internal.formatBoxShadow shade)
172238
173239
174240{-| -}
@@ -190,7 +256,10 @@ innerShadow almostShade =
190256 }
191257 in
192258 Internal.StyleClass Flag.shadows <|
193− Internal.Single (Internal.boxShadowName shade) "box-shadow" (Internal.formatBoxShadow shade)
259+ Internal.Single
260+ (Internal.boxShadowName shade)
261+ "box-shadow"
262+ (Internal.formatBoxShadow shade)
194263
195264
196265