Add validation when save the frontend styles

This commit closes the #5298