Skip to content

Commit ab88bbb

Browse files
committed
Fix textDecoration backwards compatible
1 parent de0a1fd commit ab88bbb

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

packages/runtime/native/shared/Css_types.ml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3243,10 +3243,10 @@ end
32433243

32443244
module TextDecoration = struct
32453245
type value = {
3246-
line : TextDecorationLine.Value.t;
3247-
thickness : TextDecorationThickness.Value.t;
3248-
style : TextDecorationStyle.Value.t;
3249-
color : Color.t;
3246+
line : TextDecorationLine.Value.t option;
3247+
thickness : TextDecorationThickness.Value.t option;
3248+
style : TextDecorationStyle.Value.t option;
3249+
color : Color.t option;
32503250
}
32513251

32523252
type t =
@@ -3256,20 +3256,26 @@ module TextDecoration = struct
32563256
| None.t
32573257
]
32583258

3259-
let make ?(line = `none) ?(thickness = `auto) ?(style = `solid)
3260-
?(color = `currentColor) () =
3259+
let make ?line ?thickness ?style ?color () =
32613260
`value { line; thickness; style; color }
32623261

32633262
let toString x =
32643263
match x with
32653264
| `value x ->
3266-
TextDecorationLine.Value.toString x.line
3267-
^ {js| |js}
3268-
^ TextDecorationThickness.Value.toString x.thickness
3269-
^ {js| |js}
3270-
^ TextDecorationStyle.Value.toString x.style
3271-
^ {js| |js}
3272-
^ Color.toString x.color
3265+
(match x.line with
3266+
| Some line -> TextDecorationLine.Value.toString line ^ {js| |js}
3267+
| None -> {js||js})
3268+
^ (match x.thickness with
3269+
| Some thickness ->
3270+
TextDecorationThickness.Value.toString thickness ^ {js| |js}
3271+
| None -> {js||js})
3272+
^ (match x.style with
3273+
| Some style -> TextDecorationStyle.Value.toString style ^ {js| |js}
3274+
| None -> {js||js})
3275+
^
3276+
(match x.color with
3277+
| Some color -> Color.toString color
3278+
| None -> {js||js})
32733279
| #Var.t as va -> Var.toString va
32743280
| #Cascading.t as c -> Cascading.toString c
32753281
| #None.t -> None.toString

0 commit comments

Comments
 (0)