With this API this would be:
.target {
anchor-name: --myname;
}
.tooltip {
left: anchor(--myname left);
bottom: calc(anchor(--myname top) - 20px);
}
https://jsfiddle.net/3rasnhyp/