How to reuse and compose shapes within the same file #2014
Unanswered
sonicsmooth
asked this question in
Q&A
Replies: 1 comment 4 replies
-
vars can do this. unless i'm misunderstanding, this is the same issue as #1891 (comment) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to be able to reuse a hierarchy of shapes:
For example:
should result in
I can do this by defining mycomponent in another file and then using ...@filename, but I'd like to keep the component definition in the main file.
It seems like classes can be used to compose properties and styles, but not shapes.
eg https://github.com/terrastruct/d2/discussions/1087
This doesn't work:
It seems like vars can't contain shapes.
Perhaps I'm missing something obvious with these.
thanks
Beta Was this translation helpful? Give feedback.
All reactions