home-page/src/assets/main.scss
2025-04-30 22:36:01 +08:00

105 lines
2.0 KiB
SCSS

@use "sass:color";
@import url('./fonts.css');
// 定义颜色变量和提亮函数
@function lighten-for-dark($color, $amount: 15%) {
@return color.adjust($color, $lightness: $amount);
}
// 基础颜色变量
$blue: #3498db;
$brown: #645b21;
$orange: #DF8146;
:root {
// 默认亮色模式
--color-border: #000000;
--text-color: #000000;
--text-color-disabled: #999999;
--text-color-gray: #666666;
--text-color-blue: #{$blue};
--text-color-brown: #{$brown};
--text-color-orange: #{$orange};
--border: solid 0.0625rem var(--color-border);
--border-radius: 0.25rem;
// 黑暗模式媒体查询
@media (prefers-color-scheme: dark) {
--color-border: #ffffff;
--text-color: #ffffff;
--text-color-disabled: #999999;
--text-color-gray: #cccccc;
// 自动提亮颜色
--text-color-blue: #{lighten-for-dark($blue, 20%)};
--text-color-brown: #{lighten-for-dark($brown, 30%)};
--text-color-orange: #{lighten-for-dark($orange, 15%)};
}
@media screen and (max-width: 420px) {
font-size: 14px;
}
}
body {
margin: 0;
background-image: url('./img/Paper.png');
background-size: contain;
font-family: 'Noto Serif SC Variable', 'Times New Roman', Times, serif;
color: var(--text-color);
line-height: 1.5;
@media (prefers-color-scheme: dark) {
background-image: url('./img/Paper_dark.png');
}
}
button {
height: 3rem;
border: var(--border);
border-radius: var(--border-radius);
background-color: transparent;
color: var(--text-color);
cursor: pointer;
}
button:disabled {
cursor: not-allowed;
border-radius: var(--border-radius);
background-color: transparent;
color: var(--text-color-disabled);
border-color: var(--text-color-disabled);
}
select {
height: 2.5rem;
width: 10rem;
}
* {
box-sizing: border-box;
}
a {
color: var(--text-color);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
#app {
display: flex;
flex-direction: column;
min-height: 100dvh;
min-height: 100vh;
}