To take care of yourself is definitely a good thing. There is nothing superficial about wanting to look the best you can. But the reason why you should work on yourself must be to make a person you see in the mirror feel good!
You won't believe how many ladies are under so much pressure (especially after they give birth) to instantly change their bodies/slim down or get particular shape not cuz of themselves but out of fear that their man will lose interest in them and start cheating.
Well,if the way you look makes you feel depressed because you don't think your man finds you appealing no more,than you should look for another man.
The truth is,your partner should encourage you and motivate you to be the best you can be (in every single way) and get you on the right track with his love and support,not with a fear of you getting replaced/cheated on.
Love and physical attraction that comes out of love must have a way deeper foundation and base. On the other hand,something is wrong somewhere in your world if the love you have for someone else makes you do things that love you have for yourself can't.
Root of your problem is not 10kg you are trying to loose.
If man doesn't make you feel good,if he doesn't support you or make you feel happy(no matter situation!) ,if your pregnancy will make you less attractive to him and "force" him to cheat,than even the most perfect body won't solve an issue.
Because that man is not your man.
You will have to learn how to work on yourself for the sake of yourself. To invest in building self love and to discover and understand what defines your worth as a woman and a human being. Once you fall in deep love with yourself you will understand how much your addition can be into a man's life and that there is no reason to be afraid of being replaced by anyone in any way.
Even with some extra pounds.
The way you see and appreciate yourself is exactly the same way others will see and appreciate you as well.