Skip to content

Commit 4a54389

Browse files
authored
Fix polygon grammar (#549)
* fix: wrong polygon grammar * chore: font-family quoted not yet promoted
1 parent a4e3c46 commit 4a54389

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

packages/css-property-parser/lib/Parser.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ and function_paint = [%value.rec
357357
and function_path = [%value.rec "path( <string> )"]
358358
and function_perspective = [%value.rec "perspective( <property-perspective> )"]
359359
and function_polygon = [%value.rec
360-
"polygon( [ <fill-rule> ]? ',' [ <extended-length> | <extended-percentage> <extended-length> | <extended-percentage> ]# )"
360+
"polygon( [ <fill-rule> ',' ]? [ <length-percentage> <length-percentage> ]# )"
361361
]
362362
and function_radial_gradient = [%value.rec
363363
"radial-gradient( <ending-shape>? <radial-size>? ['at' <position> ]? ','? <color-stop-list> )"

packages/ppx/test/css-support/fonts-module.t/run.t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ If this test fail means that the module is not in sync with the ppx
1515

1616
$ dune describe pp ./input.re | sed '1,/^];$/d'
1717

18-
CSS.fontFamilies([|{js|Inter Semi Bold|js}|]);
18+
CSS.fontFamilies([|`quoted({js|Inter Semi Bold|js})|]);
1919
CSS.fontFamilies(fonts: array(CSS.Types.FontFamilyName.t));
20-
CSS.fontFamilies([|{js|Inter|js}|]);
20+
CSS.fontFamilies([|`quoted({js|Inter|js})|]);
2121
CSS.fontFamilies(font: array(CSS.Types.FontFamilyName.t));
22-
CSS.fontFamilies([|{js|Inter|js}, {js|Sans|js}|]);
23-
CSS.fontFamilies([|{js|Inter|js}, font|]);
24-
CSS.fontFamilies([|{js|Gill Sans Extrabold|js}, "sans-serif"|]);
22+
CSS.fontFamilies([|`quoted({js|Inter|js}), `quoted({js|Sans|js})|]);
23+
CSS.fontFamilies([|`quoted({js|Inter|js}), font|]);
24+
CSS.fontFamilies([|`quoted({js|Gill Sans Extrabold|js}), `sans_serif|]);
2525

2626
CSS.fontSynthesisWeight(`none);
2727
CSS.fontSynthesisStyle(`auto);

packages/ppx/test/css-support/masking-module.t/input.re

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[%css {|clip-path: url('#clip')|}];
22
[%css {|clip-path: inset(50%)|}];
33
[%css {|clip-path: path('M 20 20 H 80 V 30')|}];
4+
[%css {|clip-path: polygon(50% 100%, 0 0, 100% 0)|}];
5+
[%css {|clip-path: polygon(evenodd, 0% 0%, 50% 50%, 0% 100%)|}];
6+
[%css {|clip-path: polygon(nonzero, 0% 0%, 50% 50%, 0% 100%)|}];
47
[%css {|clip-path: border-box|}];
58
[%css {|clip-path: padding-box|}];
69
[%css {|clip-path: content-box|}];

packages/ppx/test/css-support/masking-module.t/run.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ If this test fail means that the module is not in sync with the ppx
1717
CSS.unsafe({js|clipPath|js}, {js|url('#clip')|js});
1818
CSS.unsafe({js|clipPath|js}, {js|inset(50%)|js});
1919
CSS.unsafe({js|clipPath|js}, {js|path('M 20 20 H 80 V 30')|js});
20+
CSS.unsafe({js|clipPath|js}, {js|polygon(50% 100%, 0 0, 100% 0)|js});
21+
CSS.unsafe(
22+
{js|clipPath|js},
23+
{js|polygon(evenodd, 0% 0%, 50% 50%, 0% 100%)|js},
24+
);
25+
CSS.unsafe(
26+
{js|clipPath|js},
27+
{js|polygon(nonzero, 0% 0%, 50% 50%, 0% 100%)|js},
28+
);
2029
CSS.unsafe({js|clipPath|js}, {js|border-box|js});
2130
CSS.unsafe({js|clipPath|js}, {js|padding-box|js});
2231
CSS.unsafe({js|clipPath|js}, {js|content-box|js});

0 commit comments

Comments
 (0)