Preheat the oven to 350°F. Line cupcake pans with paper liners.
In a medium bowl, whisk together the flour, cocoa powder and salt. Set aside.
In a large mixing bowl, use an electric mixer to beat the butter on medium speed for 30 seconds. Add the sugar and vanilla; beat until combined. One at a time, add the eggs; beat on medium speed after each. Beat in the food coloring on low.
Alternately add the flour mixture and the buttermilk to the egg mixture; beat on low-medium after each just until combined. In a small bowl, stir together the baking soda and vinegar. Add to the batter; beat just until combined.
Fill the cupcake liners two-thirds full. Bake 15 to 17 minutes, or until a toothpick inserted near the centers comes out clean. Cool the pans on wire racks for 10 minutes. Gently remove the cupcakes from the pans; cool.
PREPARE THE FROSTING:
In a medium saucepan, whisk together the milk, flour and salt. Cook and stir over medium heat until thickened and bubbly. Reduce the heat; cook and stir 2 minutes more. Transfer to a small bowl; cover the surface with plastic wrap. Refrigerate until cooled (do not stir).
In a large bowl, use an electric mixer to beat the butter, sugar and vanilla on medium speed for 5 minutes until light and fluffy and the sugar is almost dissolved. Add the cooled milk mixture, 1/4 cup at a time; beat on low after each until smooth.
Use an open tip on a piping bag to frost the cupcakes. Keep refrigerated until ready to serve.
Notes
Note: this is a really unique buttercream frosting recipe that is softer than typical frosting recipes. It's very good, but you can certainly try another kind of frosting recipe if you prefer. This one won't pipe on with grooved shaping.