Skip to content

Commit 6f20f59

Browse files
vrugtehagelAdam Argyle
authored andcommitted
Add missing <basic-shape> functions; path(), rect() and xywh()
1 parent b5dbe13 commit 6f20f59

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

CSS3.sublime-syntax

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,9 @@ contexts:
631631
- include: func-inset
632632
- include: func-ellipse-circle
633633
- include: func-polygon
634+
- include: func-path
635+
- include: func-rect
636+
- include: func-xywh
634637

635638
blend-mode:
636639
- match: '(?x)
@@ -2557,6 +2560,22 @@ contexts:
25572560
- include: angle
25582561
- include: size
25592562

2563+
func-rect:
2564+
- match: \b(rect)(\()
2565+
captures:
2566+
1: support.function.rect.css
2567+
2: punctuation.section.function.begin.css
2568+
push:
2569+
- meta_scope: meta.function.rect.css
2570+
- include: end-func
2571+
- include: func-var
2572+
- match: '\bround{{b}}'
2573+
scope: support.constant.property-value.css
2574+
- include: shape-arg
2575+
- match: '\/'
2576+
scope: keyword.operator.arithmetic.css
2577+
2578+
25602579
func-red-green-blue-alpha-a:
25612580
- match: \b(red|green|blue|alpha|a)(\()
25622581
captures:
@@ -2902,6 +2921,21 @@ contexts:
29022921
- include: percentage
29032922
- include: color-adjuster-operator
29042923

2924+
func-xywh:
2925+
- match: \b(xywh)(\()
2926+
captures:
2927+
1: support.function.xywh.css
2928+
2: punctuation.section.function.begin.css
2929+
push:
2930+
- meta_scope: meta.function.xywh.css
2931+
- include: end-func
2932+
- include: func-var
2933+
- match: '\bround{{b}}'
2934+
scope: support.constant.property-value.css
2935+
- include: shape-arg
2936+
- match: '\/'
2937+
scope: keyword.operator.arithmetic.css
2938+
29052939
generic-voice:
29062940
- match: '\b(?:young|old|neutral|male|female|child){{b}}'
29072941
scope: support.constant.property-value.css

test/property-list.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,14 +2086,14 @@
20862086
122px 57px, 184px 73px, 198px 105px, 199px 150px,
20872087
145px 159px, 155px 139px, 126px 120px, 112px 138px,
20882088
80px 128px, 39px 126px, 24px 104px);
2089-
2089+
clip-path: path("M0 0L1 1Q1,2-3-3Zm5 5.6.6.6Z");
2090+
clip-path: rect(5px 5px 160px 20% 145px round 20%);
20902091
clip-rule: initial;
20912092
clip-rule: inherit;
20922093
clip-rule: unset;
20932094
clip-rule: nonzero;
20942095
clip-rule:evenodd ;
20952096

2096-
20972097
/* out of range 0-100% */
20982098

20992099
/* valid */

0 commit comments

Comments
 (0)