It isn’t the
:after pseudo-elements causing the trouble, it’s the
+ (adjacent sibling) combinator. The selector you cite should match an element with class equal to
panel if it immediately follows another one with the same parent, but it doesn’t immediately follow because of the
script elements that Ember puts in between. It’s the same phenomenon as the way
:last-child don’t work as you expect.
The only immediately obvious way round this is to over-ride the rule in your own style sheet, using a simpler selector, (something like
.panel-group panel and then add a special case for
:first-of-type to get rid of the margin on the first one) but if this idiom is used widely throughout Bootstrap, that is not likely to be practical as a general solution.