css实现浏览器黑暗明亮模式手动切换或自动跟随系统代码

代码语言:html

所属分类:其他

代码描述:css实现浏览器黑暗明亮模式手动切换或自动跟随系统代码

代码标签: css 浏览器 黑暗 明亮 模式 手动 切换 自动 跟随 系统 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
/* Basic css - do not care about that, the tricks are below*/
@import url('https://fonts.googleapis.com/css2?family=Funnel+Display:wght@300..800&display=swap');
body, html { box-sizing: border-box; height: 100%; font-family: "Funnel Display", serif;}
body {  margin: 0px; height: 100%; display: flex; align-items: center; justify-content: center; background-position: -100% 0%; font-size: 1.3em; font-weight: 300; }
h1 { font-weight: 200; font-size:1.5em;}
/* End of basic css */

/* Setting color variables - global and default */
:root {
	--backgroundColor: #fff;
	--color: #222;
}

/* Default colors using defined variables */
body {
	background-color: var(--backgroundColor );
	color: var(--color);.........完整代码请登录后点击上方下载按钮下载查看

网友评论0