I think I know where the confusion comes from. You need at least two criteria to define a magmatic rock: a composition, and a texture. A magma of the same composition can yield two different rocks depending on the texture. For instance, a mafic melt can yield a gabbro if the texture is coarse-grained, or a basalt if it is fine-grained. Same with a felsic melt and granite/rhyolite.
Now, usually, intrusive rocks tend to be coarse-grained, because they cool slowly, hence crystals have time to grow. And usually, extrusive rocks tend to be fine-grained because they cool quickly, so crystals don't have enough time to grow. That's why one could think that basalt is restricted to extrusive rocks. But if you take a mafic melt, and cool it quickly in an intrusive setting, then you end up with a mafic, fine-grained rock, i.e., a basalt. This can happen with sills, which can be quite thin (< 1 m in some cases) thus can cool quickly due to the contact with the cold, host rock.