Yellow mucus indicates your immune system is actively fighting off an infection. White blood cells sent to attack the infection die and release enzymes that give mucus its yellowish color.
Usually, when a dog vomits bile, it will be a small amount of vomit with a yellow foamy appearance. Bile in vomit can also appear like a slimy yellow mucus. Sometimes yellow dog vomit can be watery.