How to add a specific body class for the dark (or light) mode?

Would you mind explaining why you need specific classes added to the body for dark or light mode?

Does this core feature not allow what you are needing?