react实现支持夜晚暗黑模式可伸缩折叠的菜单栏效果代码
代码语言:html
所属分类:菜单导航
代码描述:react实现支持夜晚暗黑模式可伸缩折叠的菜单栏效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");
* {
box-sizing: border-box;
}
body {
--main-bg: #f5f4fd;
--item-hover: #f9f8fb;
--secondary-bg: #251d33;
--main-container-bg: #fff;
--container-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
--text-color: #00071d;
}
body.dark {
--main-bg: #00071d;
--item-hover: #1c2339;
--secondary-bg: #36415e;
--main-container-bg: #131c31;
--text-color: #fff;
--tooltip-bg: #251d33;
--container-shadow: rgba( #131c31, 0.2) 0px 7px 29px 0px;
}
html, body {
width: 100%;
margin: 0;
height: 100%;
font-family: "Poppins", sans-serif;
}
body {
background-color: var(--main-bg);
transition: 0.3s ease-in-out;
display: flex;
justify-content: center;
align-items: center;
}
.sidebar-wrapper {
display: flex;
flex-direction: column;
height: 100%;
}
@media screen and (max-height: 520px) {
.sidebar-wrapper {
overflow-y: auto;
overflow-x: hidden;
}
}
.sidebar-container {
background-color: var(--main-container-bg);
box-shadow: var(--container-shadow);
border-radius: 10px;
padding: 16px;
transition: width 0.3s ease-in-out;
position: relative;
width: 240px;
height: 100vh;
max-height: 600px;
}
.sidebar-containe.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0