Skip to content

Commit d060276

Browse files
committed
add new example
1 parent eb8ffaa commit d060276

1 file changed

Lines changed: 44 additions & 1 deletion

File tree

src/examples.js

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,50 @@ export default {
776776
d: @M3(M 0 0 @Plot(r: 3.1));
777777
}
778778
}
779-
`)
779+
`),
780+
781+
'classic pattern': read(`
782+
svg {
783+
viewBox: 0 0 10 10;
784+
preserveAspectRatio: xMidYMid slice;
785+
786+
--bc: #f9df90;
787+
--fc: #1f2e36;
788+
--size: 10%;
789+
790+
defs symbol#circle {
791+
viewBox: 0 0 10 10;
792+
g {
793+
stroke-width: 1;
794+
stroke: @p(--fc);
795+
fill: @p(--bc);
796+
circle*10-1 {
797+
cx, cy: @match(n<6, 0 10, 10 0);
798+
r: $(1 + @n.match(n<6, -1, -6) * 2);
799+
}
800+
}
801+
}
802+
rect {
803+
width, height: 100%;
804+
fill: defs pattern {
805+
viewBox: 0 0 10 10;
806+
width, height: @p(--size);
807+
rect {
808+
x, y: 0;
809+
width, height: 100%;
810+
fill: @p(--bc);
811+
}
812+
use*4 {
813+
href: #circle;
814+
width, height: 50%;
815+
transform:
816+
translate(@pn(0, 10 0, 0 10, 10 10))
817+
rotate(@pn(0, 90, -90, 180));
818+
}
819+
}
820+
}
821+
}
822+
`),
780823
}
781824

782825
function read(input) {

0 commit comments

Comments
 (0)