01 - Preheat oven to 350°F. Line a 9x13-inch baking pan with parchment paper and lightly grease.
02 - In a large mixing bowl, beat softened butter and granulated sugar with an electric mixer until light and fluffy, about 2 to 3 minutes.
03 - Add eggs one at a time, mixing well after each addition. Stir in pure vanilla extract.
04 - In a separate bowl, whisk together all-purpose flour, baking powder, and salt.
05 - Gradually add the dry mixture to the wet ingredients, mixing until just combined.
06 - Evenly spread the dough into the prepared baking pan, smoothing the surface with a spatula.
07 - Bake for 18 to 22 minutes, until edges are lightly golden and center is set. Avoid overbaking.
08 - Allow the bars to cool completely in the pan on a wire rack.
09 - Beat softened butter until creamy. Gradually mix in powdered sugar, then beat in vanilla extract and heavy cream until frosting is light and fluffy, about 2 minutes.
10 - Divide frosting evenly among three bowls. Leave one portion plain, color one red with gel coloring and the other blue.
11 - Spoon colorful frostings onto cooled cookie bars. Swirl gently with an offset spatula for a marbled effect or frost in stripes.
12 - Immediately top with red, white, and blue sprinkles.
13 - Cut into 24 bars and serve.