Preheat the oven to 350°F (175°C). Line a 9×13-inch baking pan with parchment paper, leaving an overhang on the long sides to lift out the bars later. Lightly spray the parchment and sides of the pan with nonstick spray.
nonstick baking spray, parchment paper
In a large mixing bowl or in a stand mixer fitted with the paddle attachment, beat 1 cup (2 sticks) softened unsalted butter and the granulated sugar on medium-high speed for 2–3 minutes, until light, pale, and fluffy.
1 cup unsalted butter, 1 1/4 cups granulated sugar
Beat in the eggs one at a time, mixing well after each addition and scraping down the bowl as needed. Add 2 teaspoons vanilla extract and the almond extract (if using) and mix until fully combined.
2 large eggs, 2 teaspoons pure vanilla extract, 1/2 teaspoon almond extract
In a separate bowl, whisk together the flour, cornstarch, baking powder, baking soda, and salt until well combined and no clumps remain.
2 3/4 cups all-purpose flour, 2 teaspoons cornstarch, 1/2 teaspoon baking powder, 1/2 teaspoon baking soda, 1/2 teaspoon fine sea salt
Add the dry ingredient mixture to the butter mixture in two additions, mixing on low speed just until combined after each addition. The dough will be thick but soft; if it looks slightly crumbly, continue mixing briefly until it comes together.
2 3/4 cups all-purpose flour, 2 teaspoons cornstarch, 1/2 teaspoon baking powder, 1/2 teaspoon baking soda, 1/2 teaspoon fine sea salt
Transfer the dough to the prepared pan. Use a spatula or lightly oiled/greased fingertips to press it into an even layer all the way to the edges and corners for even baking.
Bake at 350°F (175°C) for 16–20 minutes, or until the edges are just lightly golden and the center looks set but still soft. The top should remain pale, not deeply browned. A toothpick inserted near the center should come out mostly clean with a few moist crumbs. Do not overbake.
Place the pan on a wire rack and let the bars cool completely in the pan, 45–60 minutes. Do not frost until the bars are fully cooled or the frosting will melt and slide.
In a medium bowl, beat 1/2 cup (1 stick) softened unsalted butter until creamy, about 1 minute. Add 2 cups of the powdered sugar and mix on low speed until combined. Add 3 tablespoons of heavy cream or milk, the peppermint extract, vanilla extract, and a pinch of salt. Mix until smooth.
1/2 cup unsalted butter, 4 cups powdered sugar, 3-4 tablespoons heavy cream or whole milk, 1 1/2 teaspoons pure peppermint extract, 1 teaspoon pure vanilla extract, 1 pinch salt
Add the remaining 2 cups powdered sugar and beat on medium-high speed for 2–3 minutes, until smooth, light, and fluffy. If the frosting is too thick, add more cream or milk, 1 teaspoon at a time; if too thin, add a little more powdered sugar. Beat in 2–3 drops red gel food coloring, if using, until the frosting is a soft pink.
4 cups powdered sugar, 3-4 tablespoons heavy cream or whole milk, 2-3 drops red gel food coloring
Gently fold 1/2 cup finely crushed candy canes or peppermint candies into the peppermint frosting until evenly distributed.
1/2 cup crushed candy canes or peppermint candies
Once the cookie bars are completely cool, use the parchment overhang to lift the slab out of the pan and transfer it to a cutting board. Spread the peppermint frosting evenly over the top, using an offset spatula or the back of a spoon to create swirls if desired.
Sprinkle the frosted bars with additional crushed candy canes or holiday sprinkles. Use a sharp knife to cut into 20–24 squares or rectangles, wiping the blade between cuts for clean edges. Serve at room temperature.
1/2 cup crushed candy canes or peppermint candies