The only issue here is browser support, which is good, but not great yet. You can use input:not(:placeholder-shown):valid for excellent browser support, and a very similar result though!
On this page of the site you can watch the video online A simple update for better form UX with a duration of hours minute second in good quality, which was uploaded by the user Kevin Powell 15 August 2024, share the link with friends and acquaintances, this video has already been watched 203,785 times on youtube and it was liked by 15 thousand viewers. Enjoy your viewing!