-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
improve css tests #458
improve css tests #458
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
f67f345
to
db0c27c
Compare
/* expect([%css("background-image: linear-gradient(5deg, #FF0000 10%)")])->toBe({ | ||
"backgroundImage": "linear-gradient(5deg, #FF0000 10%)", | ||
}) | ||
expect([%css("background-image: repeating-linear-gradient(6rad, #000000 20%)")])->toBe({ | ||
"backgroundImage": "repeating-linear-gradient(6rad, #000000 20%)", | ||
}) | ||
expect([%css("background-image: radial-gradient(#FFFF00 30%)")])->toBe({ | ||
"backgroundImage": "radial-gradient(#FFFF00 30%)", | ||
}) | ||
expect([%css("background-image: repeating-radial-gradient(#FFFF00 30%)")])->toBe({ | ||
"backgroundImage": "repeating-radial-gradient(#FFFF00 30%)", | ||
}) */ | ||
}) | ||
) | ||
|
||
/* describe("Gradient background", () => | ||
test("test values", _ => { | ||
expect([%css("background: linear-gradient(45deg, #FF0000 0, #0000FF 100%)")])->toBe({ | ||
"background": "linear-gradient(45deg, #FF0000 0, #0000FF 100%)", | ||
}) | ||
expect([%css("background: repeating-linear-gradient(45deg, #FF0000 0, #0000FF 10px)")])->toBe({ | ||
"background": "repeating-linear-gradient(45deg, #FF0000 0, #0000FF 10px)", | ||
}) | ||
expect([%css("background: radial-gradient(#FF0000 0, #0000FF 100%) ")])->toBe({ | ||
"background": "radial-gradient(#FF0000 0, #0000FF 100%)", | ||
}) | ||
expect([ | ||
%css("background: repeating-radial-gradient(#FF0000 0, #0000FF calc(20% + 5px))"), | ||
])->toBe({ | ||
"background": "repeating-radial-gradient(#FF0000 0, #0000FF calc(20% + 5px))", | ||
}) | ||
expect([%css("background: conic-gradient(from 45deg, #FF0000 0, #0000FF 100%)")])->toBe({ | ||
"background": "conic-gradient(from 45deg, #FF0000 0, #0000FF 100%)", | ||
}) | ||
}) | ||
) */ |
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.
Seems like there are some inconsistencies in the Gradient types
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.
Can you add this comment on the source?
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.
Yes, I can!
packages/css/native/Css_Js_Core.ml
Outdated
@@ -1756,8 +1755,8 @@ let string_of_amount x = | |||
let string_of_filter x = | |||
match x with | |||
| `blur v -> {js|blur(|js} ^ Length.toString v ^ {js|)|js} | |||
| `brightness v -> {js|brightness(|js} ^ string_of_amount v ^ {js|%)|js} | |||
| `contrast v -> {js|contrast(|js} ^ string_of_amount v ^ {js|%)|js} | |||
| `brightness v -> {js|brightness(|js} ^ string_of_amount v ^ {js|)|js} |
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.
Good catch
@@ -226,7 +226,7 @@ let backfaceVisibility x = | |||
let backdropFilter x = |
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.
Can you fix string_of_filter in Css_Legacy_Core as well?
@@ -2038,8 +2038,8 @@ module Filter = struct | |||
let toString x = |
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.
Oh, we have Filter.toString in AtomicTypes. Can you use Filter.toString in Css_Js_Core, Css_Legacy_Core instead of the same implementation of the functions?
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, good spot!
@@ -1231,19 +1231,19 @@ and property_margin_block = [%value.rec "[ <'margin-left'> ]{1,2}"] | |||
and property_margin_block_end = [%value.rec "<'margin-left'>"] | |||
and property_margin_block_start = [%value.rec "<'margin-left'>"] | |||
and property_margin_bottom = [%value.rec | |||
"<extended-length> | <extended-percentage> | 'auto'" | |||
"<extended-length> | <extended-percentage> | 'auto' | <var()>" |
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.
Instead of adding var into margin-bottom, can you add it into extended-length/extended-percentage?
] | ||
and property_margin_inline = [%value.rec "[ <'margin-left'> ]{1,2}"] | ||
and property_margin_inline_end = [%value.rec "<'margin-left'>"] | ||
and property_margin_inline_start = [%value.rec "<'margin-left'>"] | ||
and property_margin_left = [%value.rec | ||
"<extended-length> | <extended-percentage> | 'auto'" | ||
"<extended-length> | <extended-percentage> | 'auto' | <var()>" |
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.
Same, let's keep var in the "extended-*" values
c31b1be
to
640f237
Compare
Addresses #425