Vertical/Horizontal stack combined

The request

I would like to have the stack cards combined. So how this would work is it’s a horizontal stack by default, but you set up the max amount of stacks it can take so that if that’s reached it will become a vertical stack so it would start under again as a horizontal stack.

For example instead of having this code:

type: vertical-stack
cards:
- type: horizontal-stack
  cards:
    - type: button
      name: button 1 
    - type: button
      name: button 2
- type: horizontal-stack
  cards:
    - type: button
      name: button 3
    - type: button
      name: button 4

You will have this code:

type: combined-stack
columns: 2
cards:
  - type: button
    name: button 1 
  - type: button
    name: button 2
  - type: button
    name: button 3
  - type: button
    name: button 4

The alternatives

I’m using the custom card layout-card right now, it can set max_columns and has the same effect.

Additional information