Ruby On Rails - Stop turbo-frame breaking your document flow.

Often you want to wrap some page content with a turbo-frame to allow targetting and updating in isolation.

However, adding a turbo-frame can break some document flow, for example if its inside some nested flex or grid containers.

You can add classes to your turbo-frame to add the styles needed to keep the document flow, but instead just add this css -

turbo-frame {
  display: contents;
}

and the frame will no longer alter the document flow.