You can copy the code and paste it in the customiser area of your theme by going to Appearance-> Customizer -> Additional CSS or Put it in the Elementor theme style’s custom css area.
Don’t forget to change various colours when the dark mode is active. BG stands for background when dark mode is active, link is the link color when the dark mode is active and so on.
In case you want to change any other properties, target it by using html.wp-dark-mode-active and the classname of the element and style in Dark Mode.
CSS Filters to apply to images and other elements when the dark mode is active.