该方法来自大神阮一峰今天推荐的阅读:https://davidwalsh.name/dark-mode-invert-filter

 

总结就一行代码:

html {
    filter: invert(1);
}

 

当然你还可以加入更多参数调试色调。

html {
    filter: invert(1) contrast(0.95) saturate(0.5) hue-rotate(180deg);
}

 

但该方式只是一种懒惰方式,对于图片的暗黑转换并不美观,不过这至少给我们一些思路,比如鼠标移动到按钮button上后focus风格转换~~

 

相关文章:

  • 2021-12-02
  • 2021-11-26
  • 2022-12-23
  • 2021-07-02
  • 2021-08-20
  • 2021-08-29
  • 2021-06-21
猜你喜欢
  • 2021-05-25
  • 2022-12-23
  • 2021-06-09
  • 2022-02-09
  • 2021-08-28
  • 2021-08-10
  • 2022-12-23
相关资源
相似解决方案