-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support moar properties #509
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
8b0272d
to
d27fb86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing PR @zakybilfagih.
Left a few comments worth taking a look, but the rest looks very nice
//let unsupportedValue = (parser, property) => | ||
// transform_with_variable( | ||
// parser, | ||
// (~loc as _, _) => raise(Unsupported_feature), | ||
// (~loc, arg) => [[%expr [%e property(~loc)]([%e arg])]], | ||
// ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHAAAAT
Hero
(CSS.textDecoration2 | ||
~line:(CSS.Types.TextDecorationLine.Value.make ~lineThrough:true ()) | ||
()) | ||
"-webkit-text-decoration: line-through auto solid currentColor; \ | ||
text-decoration: line-through auto solid currentColor;") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, add another test for this one
@@ -2652,16 +2667,24 @@ let text_decoration_thickness = | |||
); | |||
|
|||
let text_decoration = | |||
monomorphic( | |||
polymorphic( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need poly here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, this should be mono
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, turns out it's a lot simpler using poly since we're generating the shorthand
); | ||
|
||
let render_single_animation = | ||
let render_single_animation = (~loc) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a sexy function indeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hell yea
| Error(`Invalid_value(_)) | ||
| exception (Invalid_value(_)) => Error(`Invalid_value(value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of behaviour, does this change anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the Error(`Invalid_value(_)) pattern to handle the error from render_to_expr, I think we forgot to handle this when refactoring this line
| exception (Invalid_value(v)) => Error(`Invalid_value(v)) |
The exception Invalid_value pattern is redundant though, since we transformed it already on render_to_expr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the Invalid_value payload, I think I removed it at that time because it's a bit ugly lol, just pushed a commit to make it nicer.
| `webkitFlex | ||
| `webkitInlineBox | ||
| `webkitInlineFlex ] | ||
but an expression was expected of type Css_types.Display.t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with aliasing everything is that the error is less clear (since not all polyvariants) are rendered. WDYT?
Do you think is worth it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is because the explicit type annotation on the toString method, I think maybe remove it for some properties with flat or simple polyvariant? The only problem, I think, is that it can get pretty long, esp if there is Length.t and Calc.t
mask-position: bottom 10px right
<position>