Heat butter and olive oil in a skillet.
Add sliced onions and stir well.
Cook on medium-low heat for 25 minutes.
Stir occasionally to prevent burning.
Add sugar and continue cooking.
The onions should turn golden brown.
This takes about 35 minutes total.
Season with salt and pepper.
Mix flour and salt in a bowl.
Add warm water gradually.
Knead the dough for 5 minutes.
The dough should feel smooth and elastic.
Let it rest for 15 minutes.
Cover with a damp cloth.
Divide dough into four equal pieces.
Roll each piece into a thin circle.
Use flour to prevent sticking.
Make them about 1/4 inch thick.
Place on parchment paper.
Preheat oven to 425°F (220°C).
Spread caramelized onions on each flatbread.
Sprinkle mozzarella cheese on top.
Add fresh thyme leaves.
Bake for 12-15 minutes.
The cheese should bubble and turn golden.
Let cool for 2 minutes before serving.