Resize frame to left when component size changes

I’m fairly new to Figma, seems like this ought to be easy but so far I’m stumped.
I want a frame to grow/shrink to the left when the size of once of its right-aligned components changes. Here’s an example:

When the green box changes size, the red boxes move left / right to maintain spacing. The red and blue boxes are fixed size, and the whole thing is right-aligned in another frame.

Thanks!

One technique that makes this possible is the layer reversal as described in this community file: https://www.figma.com/community/file/827362981795948391/Auto-Layout-Layer-Reversal

The example shows a vertical implementation but you can make it horizontal. By using this technique, the frame will resize to the left instead of right.