for the sake of green coding, what advice would you add to this ?
Minification :
Minify resources reduces energy costs by loading a smaller amount of resources and speeds up the loading of your websites. Resource size has a direct impact on both network and CPU utilization. Larger resources generally take longer to transfer over the network and they also take longer to process on your user’s CPU once they are transferred. So, basically, you save energy on server and user’s device.
Dead Code Elimination: Identifying unused codepaths that can be completely removed and comments.
Renaming and Reformatting: Of the code that cannot be removed, safely rename variables and remove extraneous whitespace and formatting
implementation of dark mode with css :
LCD display : no effect, back light brightness will determine the energy consumed
OLED and AMOLED display : dark mode reduce the phone’s power consumption by 42% at 100% screen brightness (saving battery life)
@media (prefers-color-scheme: dark) {
body {
background: #060606;
color: #aaaebc;
}}
@media (prefers-color-scheme: light) {
body {
background: #d8d8d8;
color:#111;
}}
how to go further ?