Firefox: How to test prefers-color-scheme?

后端 未结 3 1874
无人共我
无人共我 2021-02-03 19:02

In Firefox 67, one can use media queries to detect user preference on light or dark theme.

In my version of Firefox (under Ubuntu), it seems that my preference is light

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-03 19:05

    Another way to do this is to go to about:config, and set the devtools.inspector.color-scheme-simulation.enabled property to true.

    This adds a button to the devtools inspector tab which allows you to quickly switch between emulating light mode and dark mode on the current page.

    Eventually this feature will no longer be hidden behind a flag. You can track its progress on Bugzilla. As of November 2020, there is also a new bug for getting this flag enabled by default.

提交回复
热议问题