Just because it works, doesn't mean it's right.
I would consider this an anti-pattern.
Using the w3c supplied font scale using relative units is the better, standardized approach.
px should be avoided in anything responsive and throwing in a media query to remedy that is putting a band-aid on another band-aid.
core xf font sizing needs improvement, so it's not exactly your fault here and, hey, if it works, it works, but this should be addressed by XF in a future release IMO.