Skip to content

Commit 9f1b8db

Browse files
committed
Add css-images-4.vim
See also: http://www.w3.org/TR/2017/WD-css-images-4-20170413/ This commit also moves some properties and functions from `css3-images.vim`.
1 parent 4162325 commit 9f1b8db

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

after/syntax/css/css-images-4.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
syn match cssFontProp contained "\<image-resolution\>"
2+
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(image\|element\|conic-gradient\)\s*(" end=")" oneline keepend

after/syntax/css/css3-images.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
" TODO: create cssImagesProp group and cssImagesAttr group
21
syn match cssFontProp contained "\<object-\(fit\|position\)\>"
3-
syn match cssFontProp contained "\<image-\(resolution\|orientation\)\>"
2+
syn match cssFontProp contained "\<image-orientation\>"
43
syn keyword cssFontAttr contained contain cover snap
54
syn match cssFontAttr contained "\<from-image\>"
65
syn match cssFontAttr contained "\<scale-down\>"
7-
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(image\|\(repeating-\)\=\(linear\|radial\)-gradient\)\s*(" end=")" oneline keepend
6+
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(\(repeating-\)\=\(linear\|radial\)-gradient\)\s*(" end=")" oneline keepend

after/syntax/html.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ syn include @htmlCss syntax/css/css-fonts-3.vim
1616
syn include @htmlCss syntax/css/css-fonts-4.vim
1717
syn include @htmlCss syntax/css/css-gcpm-3.vim
1818
syn include @htmlCss syntax/css/css-grid-1.vim
19+
syn include @htmlCss syntax/css/css-images-4.vim
1920
syn include @htmlCss syntax/css/css-inline-3.vim
2021
syn include @htmlCss syntax/css/css-line-grid-1.vim
2122
syn include @htmlCss syntax/css/css-lists-3.vim

test/test.css

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,19 +363,24 @@
363363
grid-gap: auto;
364364
}
365365

366-
.images {
366+
.images-3 {
367367
object-fit: contain;
368368
object-position: cover;
369-
image-resolution: snap;
370-
image-orientation: scale-down;
369+
image-orientation: snap;
370+
display: scale-down;
371371
display: from-image;
372-
display: image("sprite.svg#xywh=40,0,20,20");
373372
display: linear-gradient(to bottom, yellow, blue);
374373
display: radial-gradient(farthest-corner at 50% 50%, yellow, green);
375374
display: repeating-linear-gradient(to bottom, yellow, blue);
376375
display: repeating-radial-gradient(farthest-corner at 50% 50%, yellow, green);
377376
}
378377

378+
.images-4 {
379+
image-resolution: image("sprite.svg#xywh=40,0,20,20");
380+
display: element(#test);
381+
display: conic-gradient(at 25% 30%, white, black 60%);
382+
}
383+
379384
.inline-3 {
380385
dominant-baseline: mathematical;
381386
alignment-baseline: ideographic;

test/test.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,17 +404,23 @@
404404
.images {
405405
object-fit: contain;
406406
object-position: cover;
407-
image-resolution: snap;
408-
image-orientation: scale-down;
407+
image-orientation: snap;
408+
display: scale-down;
409409
display: from-image;
410-
display: image("sprite.svg#xywh=40,0,20,20");
411410
display: linear-gradient(to bottom, yellow, blue);
412411
display: radial-gradient(farthest-corner at 50% 50%, yellow, green);
413412
display: repeating-linear-gradient(to bottom, yellow, blue);
414413
display: repeating-radial-gradient(farthest-corner at 50% 50%, yellow, green);
415414
}
416415
</style>
417416
<style>
417+
.images-4 {
418+
image-resolution: image("sprite.svg#xywh=40,0,20,20");
419+
display: element(#test);
420+
display: conic-gradient(at 25% 30%, white, black 60%);
421+
}
422+
</style>
423+
<style>
418424
.inline-3 {
419425
dominant-baseline: mathematical;
420426
alignment-baseline: ideographic;

0 commit comments

Comments
 (0)