Preheat oven to 350℉. Grease an 8x8 or 9x13-inch baking pan and set aside. For thicker bars, use an 8x8 pan (recommended). For thinner bars, use a 9x13 pan.
To the bowl of a stand mixer (or use an electric hand mixer and large bowl), add butter and sugar. Mix on high speed to combine, until mixture is light and fluffy. Add the egg and vanilla extract, and beat on medium speed until fully incorporated.
Add the flour and baking powder, and mix on low speed until flour is just incorporated. *Avoid overmixing, which can cause the cookie bars to be dry.
Transfer the dough into prepared baking dish. Press down on dough to flatten into an even layer. Bake in preheated oven for 20 to 22 minutes, or until a toothpick inserted into the center of the bars comes out dry, or with a few moist crumbs.
Remove pan from the oven and place on a wire cooling rack. Let the sugar cookie bars cool completely before frosting, at least 20 minutes.
Spread frosting over cool bars. If desired, decorate with the heart sprinkles. Slice into squares for serving.
Notes
Avoid over mixing the cookie dough, which can cause the cookie bars to be dry. It's okay if there are a few streaks of flour visible.
It's important to wait until the bars are completely cool before topping them with frosting. If you frost the dessert when it's still warm, the frosting is likely to melt.