@svg-polygon
An SVG image containing one polygon, drawn from the same commands as @shape.
Unlike a clip-path it can have a stroke.
Syntax
- @svg-polygon(<shape commands>)
- @svg-polygon(<preset>)
- shape commands
- The
points,r,x,y,rotate,scaleand other commands of@shape.frameis ignored; usestrokefor an outline.pointsgoes up to 65536. - preset
- A name from the @shape property, such as
star. A preset takes no other commands, so it is drawn with the defaults below. - stroke, stroke-width, fill, …
-
Attributes copied to the polygon: names starting with
stroke,fill,clip,marker,mask,animateordraw. Others, such asopacity, are dropped. Defaults:stroke: currentColor,stroke-width: .01,fill: none. The polygon is a background image and does not inheritcolor, socurrentColoris black; setstrokefor any other color. - padding
- Extra space around the shape, in the coordinate space where the shape spans -1 to 1. Defaults to half the stroke width.
Examples
@grid: 3 / 60vmin _1px;
background: @svg-polygon(
points: @pn(3, 4, 5, 6, 7, 8, 9, 10, 12);
stroke-width: .04;
stroke: #000;
); @grid: 1 / 60vmin;
background: @svg-polygon(
points: 200;
r: cos(4t);
stroke: #e6437d;
stroke-width: .02;
fill: #000;
); Presets, drawn with the defaults:
@grid: 3 / 60vmin _2px;
rotate: @r(360deg);
background: @svg-polygon(@p(star, heart, hexagon));