Prep and preheat: Heat the oven to 350°F (175°C). Line a 9x13-inch pan with parchment and lightly grease the sides.
Grate the zucchini: Use the large holes of a box grater.
Lightly blot with a paper towel if very watery, but don’t squeeze it dry—you want some moisture.
Mix dry ingredients: In a large bowl, whisk flour, baking powder, baking soda, cinnamon, and salt until combined.
Mix wet ingredients: In another bowl, whisk eggs, granulated sugar, brown sugar, oil, yogurt (or sour cream), and vanilla until smooth.
Combine batter: Add wet mixture to dry. Stir gently until a few streaks of flour remain. Fold in zucchini and nuts (if using) until just combined.
Do not overmix.
Bake: Spread batter evenly in the pan. Bake 23–28 minutes, until the top is set and a toothpick comes out with a few moist crumbs. Rotate once if your oven has hot spots.
Cool slightly: Let the bars cool in the pan on a rack for about 20–30 minutes.
You want them warm but not hot before frosting.
Make the caramel frosting: In a saucepan over medium heat, melt butter. Stir in brown sugar and salt. Cook, stirring, for 2 minutes until the sugar looks glossy and starts to bubble.
Whisk in 1/4 cup cream. Simmer 1–2 minutes more, then remove from heat and let stand 3–5 minutes to cool slightly.
Finish the frosting: Whisk in vanilla. Add powdered sugar in 2–3 additions, whisking until smooth and spreadable.
If too thick, add a teaspoon of cream at a time. If too thin, add a bit more powdered sugar. The frosting should be warm and pourable but not runny.
Frost the bars: Pour the warm frosting over the warm bars.
Spread quickly with an offset spatula. The frosting will set as it cools into a soft, fudgy layer.
Set and slice: Let cool completely, about 45–60 minutes, then lift out by the parchment and slice into bars.