Skip to content

Commit

Permalink
Merge pull request #48 from hail2u/svg2
Browse files Browse the repository at this point in the history
Support SVG 2 elements and attributes
  • Loading branch information
hail2u authored Dec 29, 2016
2 parents d6644dd + 33ff4c1 commit 7baa11d
Show file tree
Hide file tree
Showing 4 changed files with 231 additions and 0 deletions.
23 changes: 23 additions & 0 deletions after/syntax/css/svg2.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
syn keyword cssTagName animate animateMotion animateTransform circle clipPath cursor defs desc discard ellipse feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence filter foreignObject g hatch hatchpath image line linearGradient marker mesh meshgradient meshpatch meshrow metadata mpath path pattern polygon polyline radialGradient rect set solidcolor stop switch symbol text textPath tspan unknown use view

syn keyword cssFontProp contained cx cy d r rx ry x y
syn match cssFontProp contained "\<color-\(interpolation\|rendering\)\>"
syn match cssFontProp contained "\<fill\(-\(opacity\|rule\)\)\=\>"
syn match cssFontProp contained "\<image-rendering\>"
syn match cssFontProp contained "\<marker-\(end\|mid\|start\)\>"
syn match cssFontProp contained "\<pointer-events\>"
syn match cssFontProp contained "\<shape-rendering\>"
syn match cssFontProp contained "\<solid-\(color\|opacity\)\>"
syn match cssFontProp contained "\<stop-\(color\|opacity\)\>"
syn match cssFontProp contained "\<stroke\(-\(dash\(array\|offset\)\|line\(cap\|join\)\|miterlimit\|opacity\|width\)\)\=\>"
syn match cssFontProp contained "\<text-anchor\>"
syn match cssFontProp contained "\<vector-effect\>"

syn keyword cssFontAttr contained arcs butt crispEdges geometricPrecision optimizeQuality painted stroke viewport visibleFill visiblePainted visibleStroke
syn match cssFontAttr contained "\<bounding-box\>"
syn match cssFontAttr contained "\<context-\(fill\|stroke\)\>"
syn match cssFontAttr contained "\<fixed-position\>"
syn match cssFontAttr contained "\<miter\(-clip\)\=\>"
syn match cssFontAttr contained "\<non-\(scaling-stroke\|scaling-size\|rotation\)\>"

syn region cssFunction contained matchgroup=cssFunctionName start="\<\(child\|icc-color\)\s*(" end=")" oneline keepend
1 change: 1 addition & 0 deletions after/syntax/html.vim
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ syn include @htmlCss syntax/css/pointerevents.vim
syn include @htmlCss syntax/css/selectors-nonelement-1.vim
syn include @htmlCss syntax/css/selectors.vim
syn include @htmlCss syntax/css/selectors4.vim
syn include @htmlCss syntax/css/svg2.vim
syn include @htmlCss syntax/css/web-animations-1.vim
syn include @htmlCss syntax/css/worklets-1.vim
103 changes: 103 additions & 0 deletions test/test.css
Original file line number Diff line number Diff line change
Expand Up @@ -760,3 +760,106 @@ rtc,
template {
display: auto;
}

.svg2,
animate,
animateMotion,
animateTransform,
circle,
clipPath,
cursor,
defs,
desc,
discard,
ellipse,
feBlend,
feColorMatrix,
feComponentTransfer,
feComposite,
feConvolveMatrix,
feDiffuseLighting,
feDisplacementMap,
feDistantLight,
feDropShadow,
feFlood,
feFuncA,
feFuncB,
feFuncG,
feFuncR,
feGaussianBlur,
feImage,
feMerge,
feMergeNode,
feMorphology,
feOffset,
fePointLight,
feSpecularLighting,
feSpotLight,
feTile,
feTurbulence,
filter,
foreignObject,
g,
hatch,
hatchpath,
image,
line,
linearGradient,
marker,
mesh,
meshgradient,
meshpatch,
meshrow,
metadata,
mpath,
path,
pattern,
polygon,
polyline,
radialGradient,
rect,
set,
solidcolor,
stop,
switch,
symbol,
text,
textPath,
tspan,
unknown,
use,
view {
color-interpolation: arcs;
color-rendering: butt;
cx: crispEdges;
cy: geometricPrecision;
d: optimizeQuality;
fill-opacity: painted;
fill-rule: stroke;
fill: viewport;
image-rendering: visibleFill;
marker-end: visiblePainted;
marker-mid: visibleStroke;
marker-start: bounding-box;
pointer-events: context-fill;
r: context-stroke;
rx: fixed-position;
ry: miter;
shape-rendering: miter-clip;
solid-color: non-scaling-stroke;
solid-opacity: non-scaling-size;
stop-color: non-rotation;
stop-opacity: child(1);
stroke-dasharray: icc-color(foo);
stroke-dashoffset: auto;
stroke-linecap: auto;
stroke-linejoin: auto;
stroke-miterlimit: auto;
stroke-opacity: auto;
stroke-width: auto;
stroke: auto;
text-anchor: auto;
vector-effect: auto;
x: auto;
y: auto;
}
104 changes: 104 additions & 0 deletions test/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,110 @@
template {
display: auto;
}
</style>
<style>
.svg2,
animate,
animateMotion,
animateTransform,
circle,
clipPath,
cursor,
defs,
desc,
discard,
ellipse,
feBlend,
feColorMatrix,
feComponentTransfer,
feComposite,
feConvolveMatrix,
feDiffuseLighting,
feDisplacementMap,
feDistantLight,
feDropShadow,
feFlood,
feFuncA,
feFuncB,
feFuncG,
feFuncR,
feGaussianBlur,
feImage,
feMerge,
feMergeNode,
feMorphology,
feOffset,
fePointLight,
feSpecularLighting,
feSpotLight,
feTile,
feTurbulence,
filter,
foreignObject,
g,
hatch,
hatchpath,
image,
line,
linearGradient,
marker,
mesh,
meshgradient,
meshpatch,
meshrow,
metadata,
mpath,
path,
pattern,
polygon,
polyline,
radialGradient,
rect,
set,
solidcolor,
stop,
switch,
symbol,
text,
textPath,
tspan,
unknown,
use,
view {
color-interpolation: arcs;
color-rendering: butt;
cx: crispEdges;
cy: geometricPrecision;
d: optimizeQuality;
fill-opacity: painted;
fill-rule: stroke;
fill: viewport;
image-rendering: visibleFill;
marker-end: visiblePainted;
marker-mid: visibleStroke;
marker-start: bounding-box;
pointer-events: context-fill;
r: context-stroke;
rx: fixed-position;
ry: miter;
shape-rendering: miter-clip;
solid-color: non-scaling-stroke;
solid-opacity: non-scaling-size;
stop-color: non-rotation;
stop-opacity: child(1);
stroke-dasharray: icc-color(foo);
stroke-dashoffset: auto;
stroke-linecap: auto;
stroke-linejoin: auto;
stroke-miterlimit: auto;
stroke-opacity: auto;
stroke-width: auto;
stroke: auto;
text-anchor: auto;
vector-effect: auto;
x: auto;
y: auto;
}
</style>
</head>
<body>
Expand Down

0 comments on commit 7baa11d

Please sign in to comment.