Just a simple example of how to break down a task, a requested behavior and use the tasks to create CSS that will implemented wanted behavior.
I want required input elements to pulse when they do not have not any content . The puls effect should only apply when the element does not have focus .
Lets construct
css selectorsfor that requirement:
- Match required input elements
input[required]- If placeholder is shown , it do not have any input
:placeholder-shown- Specify that we not want to include focus states
:not(:focus)- Result
input[required]:placeholder-shown:not(:focus)