01 - Preheat oven to 350°F. Line a 9 by 13-inch baking pan with parchment paper and lightly grease the surface.
02 - In a large mixing bowl, beat the softened butter with granulated sugar using an electric mixer until the mixture is light and fluffy, about 2 to 3 minutes.
03 - Add eggs one at a time, mixing well after each addition. Stir in vanilla extract until combined.
04 - In a separate bowl, whisk together flour, baking powder, and salt until thoroughly blended.
05 - Gradually add the dry mixture to the wet ingredients, mixing on low speed until just incorporated and a soft dough forms.
06 - Evenly press the dough into the prepared baking pan and smooth the surface with a spatula.
07 - Bake on the center rack for 18 to 22 minutes, until the edges are lightly golden and the center is fully set. Avoid overbaking.
08 - Remove the pan from the oven and allow bars to cool completely in the pan on a wire rack.
09 - In a clean bowl, beat softened butter until creamy. Gradually add powdered sugar, then mix in vanilla and heavy cream or milk. Beat on high until light and fluffy, about 2 minutes.
10 - Divide frosting equally among three small bowls. Leave one bowl plain (white). Tint one portion with red gel coloring and the other with blue, mixing until desired vibrancy is achieved.
11 - Spoon alternating dollops of red, white, and blue frosting across the cooled bars. Swirl with an offset spatula for a marbled effect or spread in distinct sections for a striped look. Immediately top with red, white, and blue sprinkles to finish.
12 - Cut into 24 even bars and serve at room temperature.