In a medium bowl, mix together the flour, salt, and baking powder. Set aside.
In a large bowl using a hand-held mixer, beat together the butter and sugar until light and fluffy, about 2-3 minutes. Add the sourdough discard, egg, and vanilla extract and mix until combined.
Add the dry ingredients to the wet ingredients and mix until combined, and a smooth dough forms. Cover the mixing bowl with plastic wrap. Chill in the refrigerator for 30 minutes (or up to 2 days).
Preheat the oven to 350℉ and line a 9x13-inch baking pan with parchment paper (optional, but it makes it easier to get the baked bars out of the pan).
Using a large cookie scoop or spoon, roughly scoop the cookie dough into the baking pan. Use your hands or a spatula to evenly press the cookie dough to the edges of the pan and fill any spaces.The dough will not spread much, so you want this to be pressed fairly flat and even. We will cover it with frosting, too, so don't worry too much!
Bake for 25-30 minutes until lightly browned at the edges. Let cool in the baking pan for at least 10 minutes, then transfer to a cooling rack to cool fully.
Once the cookie bars are fully cooled, cream the butter in a medium-sized bowl until light and fluffy, 2-3 minutes, then slowly mix in the confectioner's sugar. Add the vanilla extract and milk (start with 3 Tablespoons), mixing until fully smooth and incorporated. Add more milk if you feel that the frosting is too thick. If using food coloring, add a few drops and mix until you reach your desired color.
Spread the cookie bars with a layer of frosting, add sprinkles (optional), then cut into 20 pieces, and serve!
Video
Notes
1 cookie bar = 1 serving. While not needed for leavening purposes, this recipe can be made with active sourdough starter. To do so, replace the sourdough discard with active starter (200g). You do not need to change any of the other ingredients. Be prepared that your cookies may rise more than those made with discard.