Skip to content

Commit de0a1fd

Browse files
committed
Fix textDecoration backwards compatible
1 parent 9839c12 commit de0a1fd

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

packages/runtime/native/shared/Declarations.ml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -806,17 +806,15 @@ let backgrounds x =
806806
let backgroundSize x =
807807
Rule.declaration ({js|backgroundSize|js}, BackgroundSize.toString x)
808808

809+
(* For backward compatibility *)
809810
let textDecoration x =
810-
(* For backward compatibility *)
811-
let new_x =
812-
match x with
813-
| `underline -> TextDecorationLine.Value.make ~underline:true ()
814-
| `overline -> TextDecorationLine.Value.make ~overline:true ()
815-
| `lineThrough -> TextDecorationLine.Value.make ~lineThrough:true ()
816-
| `blink -> TextDecorationLine.Value.make ~blink:true ()
817-
| `none -> TextDecorationLine.Value.make ()
818-
in
819-
Rule.declaration ({js|textDecoration|js}, TextDecorationLine.toString new_x)
811+
let declaration = {js|textDecoration|js} in
812+
match x with
813+
| `underline -> Rule.declaration (declaration, {js|underline|js})
814+
| `overline -> Rule.declaration (declaration, {js|overline|js})
815+
| `lineThrough -> Rule.declaration (declaration, {js|line-through|js})
816+
| `blink -> Rule.declaration (declaration, {js|blink|js})
817+
| `none -> Rule.declaration (declaration, {js|none|js})
820818

821819
let textDecorations ?line ?thickness ?style ?color () =
822820
Rule.declaration

0 commit comments

Comments
 (0)