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 together softened butter and granulated sugar until the mixture is light and fluffy, about 2 to 3 minutes, using an electric mixer.
03 - Add eggs one at a time, beating thoroughly after each addition. Stir in pure vanilla extract.
04 - In a separate bowl, whisk together all-purpose flour, baking powder, and salt until evenly blended.
05 - Gradually add the dry mixture to the creamed butter mixture, mixing until just combined—avoid overmixing.
06 - Evenly spread the sugar cookie dough into the prepared baking pan, smoothing the top with a spatula.
07 - Bake on the middle rack for 18 to 22 minutes, until the edges are lightly golden and the center is set. Do not overbake.
08 - Remove pan from oven and allow bars to cool completely in the pan on a wire rack.
09 - In a separate bowl, beat softened butter until creamy. Gradually add powdered sugar, then mix in pure vanilla extract and heavy cream. Beat on high for about 2 minutes until the frosting is light and fluffy.
10 - Divide frosting evenly among three bowls. Leave one bowl plain, tint the second with red gel food coloring, and the third with blue gel food coloring.
11 - Spoon dollops of each color of frosting over the cooled bars. Swirl with an offset spatula for a marbled appearance, or spread in sections for a striped effect.
12 - Immediately scatter red, white, and blue sprinkles over the frosted bars for a festive finish.
13 - Cut frosted cookie slab into 24 equal bars. Serve at room temperature.