Chrome, Edge, Firefox and Safari all treat generated content of a flex container as a flex item. The spec says "Each in-flow child of a flex container becomes a flex item", but I'm not sure if generated content counts as an in-flow child. It would be good if the spec clarified this, and perhaps had an example with a ::before or ::after being treated as a flex item.
(Similarly for grid.)