Created by: m-smith
Fixes #15270 (closed). I just added the appropriate :not() selectors to prevent the styles from being applied when the first-child is also the last-child.
:not()
first-child
last-child