Measure out your coconut oil, plant-based milk, and salt, and have them waiting near the stove.
Start with a very clean pan and pour in sugar, water, and cream of tartar. Turn on the heat to medium and let it start to boil. (Don’t stir, just swish it around a little if needed).
Allow the sauce to boil for about 5 minutes, and then start watching it very closely. After about 6-7 minutes, the bubbles will get smaller, and it will start to get a darker color and smell slightly of caramel.
When it starts to caramelize, remove it from the burner and immediately pour in the coconut oil. (At this point, you can give it a stir with a long-handled whisk.)
Pour in the plant milk and continue to stir with the whisk for about 30 seconds. (It will bubble up and spatter when you add the milk, but then turn to caramel after a few seconds of stirring).
Once the bubbling from the milk calms down, add the salt and stir for a few more seconds. (or leave out the salt for regular caramel.)
Set aside to cool.
Make the buttercream
Then cream butter, powdered sugar, and vanilla together into a fluffy buttercream.
Add the room temperature salted caramel sauce and continue to blend it with the sugar and butter. (If your caramel sauce has gotten too firm, warm it up just enough to pour it into the frosting.)
Add flour and continue to mix. (You can also use more powdered sugar instead of the flour.)
Add 1-2 teaspoons of plant-based milk if necessary to get the right texture.
Notes
Depending on the type of vegan margarine that you use, you may need to add a small amount of plant milk to the frosting to get the right consistency.
You may need to put the frosting in the fridge for about 10 minutes before piping if the caramel was too warm when you added it to the frosting.
If your frosting is too thin, add a few more tbsp of powdered sugar.
Note: The trick to making this frosting come out well is keeping the ingredients at room temperature. The butter should be just soft enough to whip into the frosting, and the caramel sauce cannot be too warm, or it will melt your frosting.