Skip to content

Commit

Permalink
Inline Var and Cascading in all properties
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx committed Jul 11, 2024
1 parent 20c0b82 commit e70349e
Show file tree
Hide file tree
Showing 8 changed files with 954 additions and 884 deletions.
6 changes: 1 addition & 5 deletions packages/ppx/test/native/Static_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,7 @@ let properties_static_css_tests = [
[%expr [%css "background-color: color-mix(in srgb, white, red)"]],
[%expr
CSS.backgroundColor(
`colorMix((
`srgb,
(CSS.white, None),
(CSS.red, None),
)),
`colorMix((`srgb, (CSS.white, None), (CSS.red, None))),
)
],
),
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/melange/CSS.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include Properties
include Declarations
include Colors
include Alias
include Rule
Expand Down
10 changes: 5 additions & 5 deletions packages/runtime/melange/Emotion_bindings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ let fontFace ~fontFamily ~src ?fontStyle ?fontWeight ?fontDisplay ?sizeAdjust ()
=
let fontFace =
[|
Kloth.Option.map ~f:Properties.fontStyle fontStyle;
Kloth.Option.map ~f:Properties.fontWeight fontWeight;
Kloth.Option.map ~f:Properties.fontDisplay fontDisplay;
Kloth.Option.map ~f:Properties.sizeAdjust sizeAdjust;
Some (Properties.fontFamily fontFamily);
Kloth.Option.map ~f:Declarations.fontStyle fontStyle;
Kloth.Option.map ~f:Declarations.fontWeight fontWeight;
Kloth.Option.map ~f:Declarations.fontDisplay fontDisplay;
Kloth.Option.map ~f:Declarations.sizeAdjust sizeAdjust;
Some (Declarations.fontFamily fontFamily);
Some
(Rule.Declaration
( "src",
Expand Down
12 changes: 6 additions & 6 deletions packages/runtime/native/CSS.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include Properties
include Declarations
include Colors
include Alias
include Rule
Expand Down Expand Up @@ -484,11 +484,11 @@ let fontFace ~fontFamily ~src ?fontStyle ?fontWeight ?fontDisplay ?sizeAdjust ()
=
let fontFace =
[|
Kloth.Option.map ~f:Properties.fontStyle fontStyle;
Kloth.Option.map ~f:Properties.fontWeight fontWeight;
Kloth.Option.map ~f:Properties.fontDisplay fontDisplay;
Kloth.Option.map ~f:Properties.sizeAdjust sizeAdjust;
Some (Properties.fontFamily fontFamily);
Kloth.Option.map ~f:Declarations.fontStyle fontStyle;
Kloth.Option.map ~f:Declarations.fontWeight fontWeight;
Kloth.Option.map ~f:Declarations.fontDisplay fontDisplay;
Kloth.Option.map ~f:Declarations.sizeAdjust sizeAdjust;
Some (Declarations.fontFamily fontFamily);
Some
(Rule.Declaration
( "src",
Expand Down
6 changes: 4 additions & 2 deletions packages/runtime/native/shared/Alias.ml
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,11 @@ module Shadow = struct
end

module Animation = struct
let shorthand = Css_types.Animation.shorthand
(* backwards compatibility *)
let shorthand = Css_types.Animation.make
end

module Transition = struct
let shorthand = Css_types.Transition.shorthand
(* backwards compatibility *)
let shorthand = Css_types.Transition.make
end
Loading

0 comments on commit e70349e

Please sign in to comment.