Mix the flour, sugar, and salt in a large mixing bowl, or the bowl of a food processor.
Cube the butter and add it into the mixture. If using a food processor, pulse lightly until the mixture forms small, loose crumbs. If mixing by hand, cut the butter in with a pastry cutter.
Add the egg, vanilla extract, and fresh rosemary to the mixture and pulse or cut in until the dough starts to come together, but hadn't formed a large ball yet.
Form the dough into a ball and wrap tightly to keep it from drying out. Chill in the fridge for at least an hour. You can also freeze the dough for a couple of months if you'd like to store it for future use.
Preheat your oven to 350°F with the rack in the center.
Once the dough is chilled, unwrap it on a lightly floured surface. If making tartlets, divide into as many equal-weight pieces as you have tins. Roll out into circles an inch or two larger than your tartlet pans, around ⅛" thick. If the dough is too stiff to work easily, allow it to rest for a few minutes at room temperature.
Press the dough gently into the tartlet pans and trim away the excess.
Press parchment paper or aluminum foil on top of the dough and fill with pie weights. You can also use dried beans or uncooked rice in place of ceramic pie weights.
Blind bake for around 8 minutes if using small tarlet pans, or around 15 minutes if using a full-size 9" tart pan. Remove the weights and covering and bake another 3-5 minutes until the inside of the shell is golden brown.